Move sc_tendermint to async sign

This commit is contained in:
Luke Parker 2022-11-01 16:28:08 -04:00
parent 2947ef08e3
commit 19154cf8e1
No known key found for this signature in database
GPG key ID: F9F1386DB1E119B6

View file

@ -1,6 +1,8 @@
use core::{marker::PhantomData, ops::Deref};
use std::sync::{Arc, RwLock};
use async_trait::async_trait;
use sp_application_crypto::{
RuntimePublic as PublicTrait, Pair as PairTrait,
sr25519::{Public, Pair, Signature},
@ -92,12 +94,13 @@ impl<T: TendermintClient> TendermintValidators<T> {
}
}
#[async_trait]
impl<T: TendermintClient> SignatureScheme for TendermintValidators<T> {
type ValidatorId = u16;
type Signature = Signature;
type AggregateSignature = Vec<Signature>;
fn sign(&self, msg: &[u8]) -> Signature {
async fn sign(&self, msg: &[u8]) -> Signature {
self.0.read().unwrap().keys.sign(msg)
}