mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-09 20:11:09 +00:00
fix compilation for native
This commit is contained in:
@@ -15,8 +15,7 @@ polkadot-state-machine = { path = "../state-machine", version = "0.1", optional
|
||||
polkadot-primitives = { path = "../primitives", version = "0.1", default_features = false }
|
||||
polkadot-runtime-codec = { path = "../runtime-codec", version = "0.1", default_features = false }
|
||||
triehash = { version = "0.1", optional = true }
|
||||
ring = { version = "0.12", optional = true }
|
||||
untrusted = { version = "0.5", optional = true }
|
||||
ed25519 = { path = "../ed25519", version = "0.1", optional = true }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -26,8 +25,7 @@ std = [
|
||||
"triehash",
|
||||
"polkadot-primitives/std",
|
||||
"polkadot-runtime-codec/std",
|
||||
"ring",
|
||||
"untrusted"
|
||||
"ed25519",
|
||||
]
|
||||
nightly = []
|
||||
strict = []
|
||||
|
||||
@@ -20,8 +20,7 @@ extern crate environmental;
|
||||
extern crate polkadot_state_machine;
|
||||
extern crate polkadot_primitives as primitives;
|
||||
extern crate triehash;
|
||||
extern crate ring;
|
||||
extern crate untrusted;
|
||||
extern crate ed25519;
|
||||
|
||||
pub use std::vec;
|
||||
pub use std::rc;
|
||||
@@ -93,16 +92,7 @@ pub fn enumerated_trie_root(serialised_values: &[&[u8]]) -> [u8; 32] {
|
||||
|
||||
/// Verify a ed25519 signature.
|
||||
pub fn ed25519_verify(sig: &[u8; 64], msg: &[u8], pubkey: &[u8; 32]) -> bool {
|
||||
use ring::signature;
|
||||
|
||||
let public_key = untrusted::Input::from(pubkey);
|
||||
let msg = untrusted::Input::from(msg);
|
||||
let sig = untrusted::Input::from(sig);
|
||||
|
||||
match signature::verify(&signature::ED25519, public_key, msg, sig) {
|
||||
Ok(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
ed25519::verify(sig, msg, pubkey)
|
||||
}
|
||||
|
||||
/// Execute the given closure with global function available whose functionality routes into the
|
||||
|
||||
Reference in New Issue
Block a user