Support different callers

This commit is contained in:
Omar Abdulla
2025-07-21 10:34:57 +03:00
parent e5a3f0aee9
commit ac6387b6f0
10 changed files with 206 additions and 103 deletions
+9 -7
View File
@@ -123,16 +123,18 @@ impl Arguments {
panic!("should have a workdir configured")
}
/// Try to parse `self.account` into a [PrivateKeySigner],
/// panicing on error.
pub fn wallet(&self) -> EthereumWallet {
let signer = self
.account
pub fn signer(&self) -> PrivateKeySigner {
self.account
.parse::<PrivateKeySigner>()
.unwrap_or_else(|error| {
panic!("private key '{}' parsing error: {error}", self.account);
});
EthereumWallet::new(signer)
})
}
/// Try to parse `self.account` into a [PrivateKeySigner],
/// panicing on error.
pub fn wallet(&self) -> EthereumWallet {
EthereumWallet::new(self.signer())
}
}