{
- /// Create a slot-claim from the given author public key, slot, and timestamp.
- ///
- /// This does not check whether the author actually owns the slot or the timestamp
- /// falls within the slot.
- pub fn unchecked(author_pub: Pub, slot: Slot, timestamp: Timestamp) -> Self
- where
- P: Pair,
- P::Public: Codec,
- P::Signature: Codec,
- {
- SlotClaim { author_pub, timestamp, pre_digest: aura_internal::pre_digest::(slot) }
- }
-
- /// Get the author's public key.
- pub fn author_pub(&self) -> &Pub {
- &self.author_pub
- }
-
- /// Get the Aura pre-digest for this slot.
- pub fn pre_digest(&self) -> &DigestItem {
- &self.pre_digest
- }
-
- /// Get the timestamp corresponding to the relay-chain slot this claim was
- /// generated against.
- pub fn timestamp(&self) -> Timestamp {
- self.timestamp
- }
-}
-
-/// Attempt to claim a slot derived from the given relay-parent header's slot.
-pub async fn claim_slot(
- client: &C,
- parent_hash: B::Hash,
- relay_parent_header: &PHeader,
- slot_duration: SlotDuration,
- relay_chain_slot_duration: Duration,
- keystore: &KeystorePtr,
-) -> Result