Do not call externalities without Ext being set (#3436)

* Do not call externalities without `Ext` being set

* Fix compare and set

* Bump runtime version.

* Bump hashmap_core
This commit is contained in:
Bastian Köcher
2019-08-19 12:52:39 +02:00
committed by Gavin Wood
parent 017752df41
commit 3b0af8bbf4
4 changed files with 56 additions and 22 deletions
+4 -4
View File
@@ -206,7 +206,7 @@ impl CryptoApi for () {
ext::with(|ext| {
ext.keystore()
.expect("No `keystore` associated for the current context!")
.write()
.read()
.ed25519_public_keys(id)
}).expect("`ed25519_public_keys` cannot be called outside of an Externalities-provided environment.")
}
@@ -233,7 +233,7 @@ impl CryptoApi for () {
.expect("No `keystore` associated for the current context!")
.read()
.ed25519_key_pair(id, &pub_key)
.map(|k| k.sign(msg.as_ref()).into())
.map(|k| k.sign(msg.as_ref()))
}).expect("`ed25519_sign` cannot be called outside of an Externalities-provided environment.")
}
@@ -245,7 +245,7 @@ impl CryptoApi for () {
ext::with(|ext| {
ext.keystore()
.expect("No `keystore` associated for the current context!")
.write()
.read()
.sr25519_public_keys(id)
}).expect("`sr25519_public_keys` cannot be called outside of an Externalities-provided environment.")
}
@@ -272,7 +272,7 @@ impl CryptoApi for () {
.expect("No `keystore` associated for the current context!")
.read()
.sr25519_key_pair(id, &pub_key)
.map(|k| k.sign(msg.as_ref()).into())
.map(|k| k.sign(msg.as_ref()))
}).expect("`sr25519_sign` cannot be called outside of an Externalities-provided environment.")
}