mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-27 18:39:32 +00:00
fmt fix
This commit is contained in:
parent
5dc7d54848
commit
a927955e04
@ -266,7 +266,6 @@ impl KeycardWallet {
|
|||||||
result
|
result
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn pairing_file_path() -> Option<PathBuf> {
|
fn pairing_file_path() -> Option<PathBuf> {
|
||||||
|
|||||||
@ -40,7 +40,8 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
match self {
|
match self {
|
||||||
Self::Available => {
|
Self::Available => {
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("`wallet::keycard::available`: unable to setup python path");
|
python_path::add_python_path(py)
|
||||||
|
.expect("`wallet::keycard::available`: unable to setup python path");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py)
|
let wallet = KeycardWallet::new(py)
|
||||||
.expect("`wallet::keycard::available`: invalid data received for pin");
|
.expect("`wallet::keycard::available`: invalid data received for pin");
|
||||||
@ -61,7 +62,8 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
let pin = read_pin()?;
|
let pin = read_pin()?;
|
||||||
|
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("`wallet::keycard::connect`: unable to setup python path");
|
python_path::add_python_path(py)
|
||||||
|
.expect("`wallet::keycard::connect`: unable to setup python path");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py)
|
let wallet = KeycardWallet::new(py)
|
||||||
.expect("`wallet::keycard::connect`: invalid keycard wallet provided");
|
.expect("`wallet::keycard::connect`: invalid keycard wallet provided");
|
||||||
@ -80,7 +82,8 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
let pin = read_pin()?;
|
let pin = read_pin()?;
|
||||||
|
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("`wallet::keycard::disconnect`: unable to setup python path");
|
python_path::add_python_path(py)
|
||||||
|
.expect("`wallet::keycard::disconnect`: unable to setup python path");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py)
|
let wallet = KeycardWallet::new(py)
|
||||||
.expect("`wallet::keycard::disconnect`: invalid keycard wallet provided");
|
.expect("`wallet::keycard::disconnect`: invalid keycard wallet provided");
|
||||||
@ -103,7 +106,8 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
let pin = read_pin()?;
|
let pin = read_pin()?;
|
||||||
|
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("`wallet::keycard::init`: unable to setup python path");
|
python_path::add_python_path(py)
|
||||||
|
.expect("`wallet::keycard::init`: unable to setup python path");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py)
|
let wallet = KeycardWallet::new(py)
|
||||||
.expect("`wallet::keycard::init`: invalid keycard wallet provided");
|
.expect("`wallet::keycard::init`: invalid keycard wallet provided");
|
||||||
@ -125,7 +129,8 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
let mnemonic = read_mnemonic()?;
|
let mnemonic = read_mnemonic()?;
|
||||||
|
|
||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("`wallet::keycard::load`: unable to setup python path");
|
python_path::add_python_path(py)
|
||||||
|
.expect("`wallet::keycard::load`: unable to setup python path");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py)
|
let wallet = KeycardWallet::new(py)
|
||||||
.expect("`wallet::keycard::load`: invalid keycard wallet provided");
|
.expect("`wallet::keycard::load`: invalid keycard wallet provided");
|
||||||
|
|||||||
@ -649,39 +649,40 @@ impl WalletCore {
|
|||||||
|
|
||||||
let mut pre_states = acc_manager.pre_states();
|
let mut pre_states = acc_manager.pre_states();
|
||||||
|
|
||||||
let (keycard_account, keycard_pin, keycard_path) =
|
let (keycard_account, keycard_pin, keycard_path) = if let Some(key_path_str) =
|
||||||
if let Some(key_path_str) = mention.and_then(CliAccountMention::key_path) {
|
mention.and_then(CliAccountMention::key_path)
|
||||||
let pin = crate::helperfunctions::read_pin().map_err(|e| {
|
{
|
||||||
ExecutionFailureKind::KeycardError(pyo3::PyErr::new::<
|
let pin = crate::helperfunctions::read_pin().map_err(|e| {
|
||||||
pyo3::exceptions::PyRuntimeError,
|
ExecutionFailureKind::KeycardError(pyo3::PyErr::new::<
|
||||||
_,
|
pyo3::exceptions::PyRuntimeError,
|
||||||
>(e.to_string()))
|
_,
|
||||||
})?;
|
>(e.to_string()))
|
||||||
let account_id_str =
|
})?;
|
||||||
KeycardWallet::get_public_account_id_for_path_with_connect(&pin, key_path_str)?;
|
let account_id_str =
|
||||||
let account_id: AccountId = match account_id_str
|
KeycardWallet::get_public_account_id_for_path_with_connect(&pin, key_path_str)?;
|
||||||
|
let account_id: AccountId = match account_id_str
|
||||||
.parse::<AccountIdWithPrivacy>()
|
.parse::<AccountIdWithPrivacy>()
|
||||||
.expect("`wallet::lib::send_privacy_preserving_tx_with_pre_check`: invalid account id parsed")
|
.expect("`wallet::lib::send_privacy_preserving_tx_with_pre_check`: invalid account id parsed")
|
||||||
{
|
{
|
||||||
AccountIdWithPrivacy::Public(id) | AccountIdWithPrivacy::Private(id) => id,
|
AccountIdWithPrivacy::Public(id) | AccountIdWithPrivacy::Private(id) => id,
|
||||||
};
|
};
|
||||||
let account = self
|
let account = self
|
||||||
.get_account_public(account_id)
|
.get_account_public(account_id)
|
||||||
.await
|
.await
|
||||||
.expect("`wallet::lib::send_privacy_preserving_tx_with_pre_check`: unable to retrieve public account");
|
.expect("`wallet::lib::send_privacy_preserving_tx_with_pre_check`: unable to retrieve public account");
|
||||||
let pin_str = pin.as_str().to_owned();
|
let pin_str = pin.as_str().to_owned();
|
||||||
(
|
(
|
||||||
Some(AccountWithMetadata {
|
Some(AccountWithMetadata {
|
||||||
account,
|
account,
|
||||||
is_authorized: true,
|
is_authorized: true,
|
||||||
account_id,
|
account_id,
|
||||||
}),
|
}),
|
||||||
Some(pin_str),
|
Some(pin_str),
|
||||||
Some(key_path_str.to_owned()),
|
Some(key_path_str.to_owned()),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
(None, None, None)
|
(None, None, None)
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut nonces: Vec<Nonce> = acc_manager.public_account_nonces().into_iter().collect();
|
let mut nonces: Vec<Nonce> = acc_manager.public_account_nonces().into_iter().collect();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user