Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter key unusable in sign_transaction #635

Open
Dirky14 opened this issue May 16, 2022 · 1 comment
Open

Parameter key unusable in sign_transaction #635

Dirky14 opened this issue May 16, 2022 · 1 comment

Comments

@Dirky14
Copy link

Dirky14 commented May 16, 2022

Hello,
The parameter Key in the sign_transaction method on the Account struct in the crate need a secp256k1::key::SecretKey. However, it seems now that the key module is private and SecretKey is reachable from secp256k1::SecretKey. Can you correct this ? Thanks !

@Nobyliti713
Copy link

Nobyliti713 commented Nov 1, 2022

I've just encountered the same problem

error[E0271]: type mismatch resolving '<&SecretKey as Deref>::Target == secp256k1:: key::SecretKey'
expected struct 'secp256k1:: key::SecretKey', found struct 'SecretKey'

code causing error:
let private_key = SecretKey::from_str(&env::var("PRIVATE_TEST_KEY").unwrap()).unwrap();
let signed_transaction = web3s.accounts().sign_transaction(transact_obj, &private_key).await.unwrap();

Crate Versions:
web3 = '0.18.0'
secp256k1 = '0.24.1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants