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