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:
David Craven
2019-07-22 11:20:57 +02:00
committed by Gavin Wood
parent 2edeef5825
commit a3d19baea3
17 changed files with 509 additions and 327 deletions
+7 -11
View File
@@ -246,9 +246,9 @@ impl offchain::Externalities for NeverOffchainExt {
unreachable!()
}
fn authority_pubkey(
fn pubkey(
&self,
_crypto: offchain::CryptoKind,
_key: offchain::CryptoKey,
) -> Result<Vec<u8>, ()> {
unreachable!()
}
@@ -256,14 +256,13 @@ impl offchain::Externalities for NeverOffchainExt {
fn new_crypto_key(
&mut self,
_crypto: offchain::CryptoKind,
) -> Result<offchain::CryptoKeyId, ()> {
) -> Result<offchain::CryptoKey, ()> {
unreachable!()
}
fn encrypt(
&mut self,
_key: Option<offchain::CryptoKeyId>,
_kind: offchain::CryptoKind,
_key: offchain::CryptoKey,
_data: &[u8],
) -> Result<Vec<u8>, ()> {
unreachable!()
@@ -271,8 +270,7 @@ impl offchain::Externalities for NeverOffchainExt {
fn decrypt(
&mut self,
_key: Option<offchain::CryptoKeyId>,
_kind: offchain::CryptoKind,
_key: offchain::CryptoKey,
_data: &[u8],
) -> Result<Vec<u8>, ()> {
unreachable!()
@@ -280,8 +278,7 @@ impl offchain::Externalities for NeverOffchainExt {
fn sign(
&mut self,
_key: Option<offchain::CryptoKeyId>,
_kind: offchain::CryptoKind,
_key: offchain::CryptoKey,
_data: &[u8],
) -> Result<Vec<u8>, ()> {
unreachable!()
@@ -289,8 +286,7 @@ impl offchain::Externalities for NeverOffchainExt {
fn verify(
&mut self,
_key: Option<offchain::CryptoKeyId>,
_kind: offchain::CryptoKind,
_key: offchain::CryptoKey,
_msg: &[u8],
_signature: &[u8],
) -> Result<bool, ()> {