Here are the steps i have done:
cargo contract new flipper
in contract code i added these lines of code:
use blst::min_pk::SecretKey;
after#![cfg_attr(not(feature = "std"), no_std)]
& changed this function:#[ink(message)] pub fn flip(&mut self) { let ikm = [0u8; 32]; let sk = SecretKey::key_gen(&ikm,&[]).unwrap(); ink_env::debug_print!("{:?}",sk); self.value = !self.value; }
Run command cargo add blst
After the completion, my Cargo.toml file changed dependencies by adding
blst = "0.3.10"
When i run: cargo+nightly contract build, i got error and warning:
SecretKey is a struct that can be found in blst::min_pk directory. Its a dependence that can be found on github. I can link it if need.
Any help how do i fix this error? If you need more information, just tell me and i will provide!
Here is full Cargo.toml: here is full Cargo.toml :
[package]
name = "testX"
version = "0.1.0"
authors = ["[your_name] <[your_email]>"]
edition = "2021"
[dependencies]
ink_primitives = { version = "3.3", default-features = false }
ink_metadata = { version = "3.3", default-features = false, features = ["derive"], optional = true }
ink_env = { version = "3.3", default-features = false }
ink_storage = { version = "3.3", default-features = false }
ink_lang = { version = "3.3", default-features = false }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2", default-features = false, features = ["derive"], optional = true }
blst = "0.3.10"
[lib]
name = "testX"
path = "lib.rs"
crate-type = [
# Used for normal contract Wasm blobs.
"cdylib",
]
[features]
default = ["std"]
std = [
"ink_metadata/std",
"ink_env/std",
"ink_storage/std",
"ink_primitives/std",
"scale/std",
"scale-info/std",
]
ink-as-dependency = []
Cargo.toml
as well?