referrerpolicy=no-referrer-when-downgrade

HopPromoter

Trait HopPromoter 

Source
pub trait HopPromoter:
    Send
    + Sync
    + 'static {
    // Required methods
    fn promote(
        &self,
        data: Vec<u8>,
        signer: MultiSigner,
        signature: MultiSignature,
        submit_timestamp: u64,
    ) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn is_promoted_on_chain(
        &self,
        hash: &[u8; 32],
    ) -> Result<bool, Box<dyn Error + Send + Sync>>;
}
Expand description

Trait for promoting HOP data to permanent on-chain storage.

Implemented as a trait object so that HopMaintenanceTask is not generic over runtime-specific types. The concrete implementation (RuntimeApiPromoter) uses the HopRuntimeApi runtime API.

Required Methods§

Source

fn promote( &self, data: Vec<u8>, signer: MultiSigner, signature: MultiSignature, submit_timestamp: u64, ) -> Result<(), Box<dyn Error + Send + Sync>>

Promote a blob of HOP data to permanent on-chain storage.

signer, signature, and submit_timestamp are the user’s hop_submit-time MultiSigner, signature, and wall-clock timestamp (ms since unix epoch), carried into the unsigned promotion extrinsic so the runtime pallet can verify consent on-chain and bound the signature’s validity window.

Source

fn is_promoted_on_chain( &self, hash: &[u8; 32], ) -> Result<bool, Box<dyn Error + Send + Sync>>

Whether hash is already stored on-chain.

Used by the maintenance task to confirm that a previously submitted promotion extrinsic was actually included in a block.

Implementors§

Source§

impl<Block, C, P> HopPromoter for RuntimeApiPromoter<Block, C, P>
where Block: BlockT, C: HeaderBackend<Block> + CallApiAt<Block> + Send + Sync + 'static, P: LocalTransactionPool<Block = Block> + 'static,