Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Offchain-worker: Update example-offchain-worker with implementation for TestAuthId #10096

Merged
merged 4 commits into from
Oct 25, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions frame/example-offchain-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,20 @@ pub mod crypto {
use sp_runtime::{
app_crypto::{app_crypto, sr25519},
traits::Verify,
MultiSigner,
MultiSignature,
};
app_crypto!(sr25519, KEY_TYPE);

pub struct TestAuthId;

impl frame_system::offchain::AppCrypto<MultiSigner, MultiSignature> for TestAuthId {
type RuntimeAppPublic = Public;
type GenericSignature = sp_core::sr25519::Signature;
type GenericPublic = sp_core::sr25519::Public;
}

// implemented for mock runtime in test
impl frame_system::offchain::AppCrypto<<Sr25519Signature as Verify>::Signer, Sr25519Signature>
for TestAuthId
{
Expand Down