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

[cast] Fix cast wallet verify #7215

Merged
merged 4 commits into from
Feb 23, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions crates/cast/bin/cmd/wallet/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use alloy_primitives::{Address, Signature, B256};
use alloy_primitives::{Address, Signature};
use alloy_signer::{
coins_bip39::{English, Mnemonic},
LocalWallet, MnemonicBuilder, Signer as AlloySigner,
Expand All @@ -12,7 +12,7 @@ use foundry_config::Config;
use foundry_wallets::{RawWalletOpts, WalletOpts, WalletSigner};
use rand::thread_rng;
use serde_json::json;
use std::{path::Path, str::FromStr};
use std::path::Path;
use yansi::Paint;

pub mod vanity;
Expand Down Expand Up @@ -273,8 +273,7 @@ impl WalletSubcommands {
println!("0x{sig}");
}
WalletSubcommands::Verify { message, signature, address } => {
let recovered_address =
signature.recover_address_from_prehash(&B256::from_str(&message)?)?;
let recovered_address = signature.recover_address_from_msg(message)?;
if recovered_address == address {
println!("Validation succeeded. Address {address} signed this message.");
} else {
Expand Down
Loading