tomusdrw / rust-web3

Ethereum JSON-RPC multi-transport client. Rust implementation of web3 library. ENS address: rust-web3.eth
MIT License
1.45k stars 465 forks source link

failed to resolve: use of undeclared crate or module `secp256k1` #641

Closed peter-jim closed 2 years ago

peter-jim commented 2 years ago

when I use rust-web3 to my project . I cant import secp256k1. but Cargo.toml is work.

[dependencies] secp256k1 = { version = "0.22.1", features = ["recovery"], optional = true } once_cell = { version = "1.8.0", optional = true }


use secp256k1::key::SecretKey;

show error failed to resolve: use of undeclared crate or module secp256k1 use of undeclared crate or module secp256k1rustcE0433

palinko91 commented 2 years ago

For me the transaction signing works with older crates only. Try web3 = "=0.17.0" secp256k1 = "=0.20.3"

peter-jim commented 2 years ago

thanks, I solved the problem.