mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-05-14 20:19:51 +00:00
Merge branch 'marvin/keycard-commands' into marvin/keycard-privacy-commands
This commit is contained in:
commit
20d3c081ae
Binary file not shown.
@ -1165,7 +1165,6 @@ async fn token_claiming_path_with_private_accounts() -> Result<()> {
|
|||||||
amount: mint_amount,
|
amount: mint_amount,
|
||||||
};
|
};
|
||||||
|
|
||||||
// This should be the one that breaks? (Marvin)
|
|
||||||
wallet::cli::execute_subcommand(ctx.wallet_mut(), Command::Token(subcommand)).await?;
|
wallet::cli::execute_subcommand(ctx.wallet_mut(), Command::Token(subcommand)).await?;
|
||||||
|
|
||||||
info!("Waiting for next block creation");
|
info!("Waiting for next block creation");
|
||||||
|
|||||||
@ -30,10 +30,11 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("keycard_wallet.py not found");
|
python_path::add_python_path(py).expect("keycard_wallet.py not found");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py).expect("Expect keycard wallet");
|
let wallet = KeycardWallet::new(py)
|
||||||
let available = wallet
|
.expect("`wallet::keycard::available`: invalid data received for pin");
|
||||||
.is_unpaired_keycard_available(py)
|
let available = wallet.is_unpaired_keycard_available(py).expect(
|
||||||
.expect("Expect a Boolean.");
|
"`wallet::keycard::available`: received invalid data from Keycard wrapper",
|
||||||
|
);
|
||||||
|
|
||||||
if available {
|
if available {
|
||||||
println!("\u{2705} Keycard is available.");
|
println!("\u{2705} Keycard is available.");
|
||||||
@ -48,10 +49,14 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
Python::with_gil(|py| {
|
Python::with_gil(|py| {
|
||||||
python_path::add_python_path(py).expect("keycard_wallet.py not found");
|
python_path::add_python_path(py).expect("keycard_wallet.py not found");
|
||||||
|
|
||||||
let wallet = KeycardWallet::new(py).expect("Expect keycard wallet");
|
let wallet = KeycardWallet::new(py)
|
||||||
|
.expect("`wallet::keycard::load`: invalid keycard wallet provided");
|
||||||
|
|
||||||
let is_connected = wallet
|
let is_connected = wallet
|
||||||
.setup_communication(py, &pin.expect("Expect a pin as a String."))
|
.setup_communication(
|
||||||
|
py,
|
||||||
|
&pin.expect("`wallet::keycard::load`: invalid data received for pin"),
|
||||||
|
)
|
||||||
.expect("Expect a Boolean.");
|
.expect("Expect a Boolean.");
|
||||||
|
|
||||||
if is_connected {
|
if is_connected {
|
||||||
@ -60,10 +65,14 @@ impl WalletSubcommand for KeycardSubcommand {
|
|||||||
println!("\u{274c} Keycard is not connected to wallet.");
|
println!("\u{274c} Keycard is not connected to wallet.");
|
||||||
}
|
}
|
||||||
|
|
||||||
drop(wallet.load_mnemonic(
|
drop(
|
||||||
py,
|
wallet.load_mnemonic(
|
||||||
&mnemonic.expect("Expect a mnemonic phrase as a string"),
|
py,
|
||||||
));
|
&mnemonic.expect(
|
||||||
|
"E`wallet::keycard::load`: invalid data received for mnemonic",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
drop(wallet.disconnect(py));
|
drop(wallet.disconnect(py));
|
||||||
});
|
});
|
||||||
|
|||||||
@ -167,7 +167,7 @@ impl WalletSubcommand for AuthTransferSubcommand {
|
|||||||
)?),
|
)?),
|
||||||
(None, None, Some(to_key_path)) => {
|
(None, None, Some(to_key_path)) => {
|
||||||
Some(KeycardWallet::get_account_id_for_path_with_connect(
|
Some(KeycardWallet::get_account_id_for_path_with_connect(
|
||||||
&pin.as_ref().expect("Expect a pin as a String."),
|
pin.as_ref().expect("`wallet::programs::native_token_transfer::send`: invalid data received for pin"),
|
||||||
&to_key_path,
|
&to_key_path,
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,13 +110,13 @@ impl NativeTokenTransfer<'_> {
|
|||||||
WitnessSet::for_message(&message, &[signing_key])
|
WitnessSet::for_message(&message, &[signing_key])
|
||||||
} else {
|
} else {
|
||||||
let pub_key = KeycardWallet::get_public_key_for_path_with_connect(
|
let pub_key = KeycardWallet::get_public_key_for_path_with_connect(
|
||||||
pin.as_ref().expect("Expect a pin as a String."),
|
pin.as_ref().expect("`wallet::program_facades::native_token_transfer::public::register_account`: invalid data received for pin for public key"),
|
||||||
key_path.as_ref().expect("Expect a key path String."),
|
key_path.as_ref().expect("`wallet::program_facades::native_token_transfer::public::register_account`: invalid data received for key_path for public_key"),
|
||||||
);
|
);
|
||||||
|
|
||||||
let signature = KeycardWallet::sign_message_for_path_with_connect(
|
let signature = KeycardWallet::sign_message_for_path_with_connect(
|
||||||
pin.as_ref().as_ref().expect("Expect a pin as a String."),
|
pin.as_ref().as_ref().expect("`wallet::program_facades::native_token_transfer::public::register_account`: invalid data received for pin for signature"),
|
||||||
key_path.as_ref().expect("Expect a key path String."),
|
key_path.as_ref().expect("`wallet::program_facades::native_token_transfer::public::register_account`: invalid data received for key_path for public_key"),
|
||||||
&message.hash_message(),
|
&message.hash_message(),
|
||||||
)
|
)
|
||||||
.expect("Expect a valid Signature.");
|
.expect("Expect a valid Signature.");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user