mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-21 14:31:02 +00:00
Refactors the offchain worker api (#3150)
* Update offchain primitives. * Update offchain worker. * Update im-online. * Update service. * Update node and node-template. * Update runtime version. * Fix build. * Fix offchain worker tests. * Generalize authority_pubkey. * Add test. * Update lib.rs
This commit is contained in:
@@ -29,7 +29,7 @@ use primitives::offchain::{
|
||||
HttpRequestStatus as RequestStatus,
|
||||
Timestamp,
|
||||
CryptoKind,
|
||||
CryptoKeyId,
|
||||
CryptoKey,
|
||||
StorageKind,
|
||||
OpaqueNetworkState,
|
||||
};
|
||||
@@ -144,18 +144,17 @@ impl offchain::Externalities for TestOffchainExt {
|
||||
unimplemented!("not needed in tests so far")
|
||||
}
|
||||
|
||||
fn authority_pubkey(&self, _kind: CryptoKind) -> Result<Vec<u8>, ()> {
|
||||
fn pubkey(&self, _key: CryptoKey) -> Result<Vec<u8>, ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
}
|
||||
|
||||
fn new_crypto_key(&mut self, _crypto: CryptoKind) -> Result<CryptoKeyId, ()> {
|
||||
fn new_crypto_key(&mut self, _crypto: CryptoKind) -> Result<CryptoKey, ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
}
|
||||
|
||||
fn encrypt(
|
||||
&mut self,
|
||||
_key: Option<CryptoKeyId>,
|
||||
_kind: CryptoKind,
|
||||
_key: CryptoKey,
|
||||
_data: &[u8],
|
||||
) -> Result<Vec<u8>, ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
@@ -163,8 +162,7 @@ impl offchain::Externalities for TestOffchainExt {
|
||||
|
||||
fn decrypt(
|
||||
&mut self,
|
||||
_key: Option<CryptoKeyId>,
|
||||
_kind: CryptoKind,
|
||||
_key: CryptoKey,
|
||||
_data: &[u8],
|
||||
) -> Result<Vec<u8>, ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
@@ -172,8 +170,7 @@ impl offchain::Externalities for TestOffchainExt {
|
||||
|
||||
fn sign(
|
||||
&mut self,
|
||||
_key: Option<CryptoKeyId>,
|
||||
_kind: CryptoKind,
|
||||
_key: CryptoKey,
|
||||
_data: &[u8],
|
||||
) -> Result<Vec<u8>, ()> {
|
||||
unimplemented!("not needed in tests so far")
|
||||
@@ -181,8 +178,7 @@ impl offchain::Externalities for TestOffchainExt {
|
||||
|
||||
fn verify(
|
||||
&mut self,
|
||||
_key: Option<CryptoKeyId>,
|
||||
_kind: CryptoKind,
|
||||
_key: CryptoKey,
|
||||
_msg: &[u8],
|
||||
_signature: &[u8],
|
||||
) -> Result<bool, ()> {
|
||||
@@ -332,4 +328,3 @@ impl offchain::Externalities for TestOffchainExt {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user