From 205c936738fd8b7b8faee61bad93c0845bbd7c70 Mon Sep 17 00:00:00 2001 From: Liu Chuankai Date: Tue, 8 Nov 2022 20:27:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20compile=20error=20a?= =?UTF-8?q?fter=20rebase=20master=20branch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/transfer_from_opentx.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/transfer_from_opentx.rs b/examples/transfer_from_opentx.rs index d2dc0439..47b2df93 100644 --- a/examples/transfer_from_opentx.rs +++ b/examples/transfer_from_opentx.rs @@ -266,7 +266,7 @@ fn main() -> Result<(), Box> { Commands::SignOpenTx(args) => { let tx_info: TxInfo = serde_json::from_slice(&fs::read(&args.tx_file)?)?; let tx = Transaction::from(tx_info.tx.inner).into_view(); - let keys = args + let keys: Vec = args .sender_key .iter() .map(|sender_key| { @@ -276,7 +276,7 @@ fn main() -> Result<(), Box> { }) .collect(); if tx_info.omnilock_config.is_pubkey_hash() || tx_info.omnilock_config.is_ethereum() { - for key in &keys { + for (i, key) in keys.iter().enumerate() { let pubkey = secp256k1::PublicKey::from_secret_key(&SECP256K1, key); let hash160 = match tx_info.omnilock_config.id().flag() { IdentityFlag::PubkeyHash => { @@ -288,7 +288,11 @@ fn main() -> Result<(), Box> { _ => unreachable!(), }; if tx_info.omnilock_config.id().auth_content().as_bytes() != hash160 { - return Err(format!("key {:#x} is not in omnilock config", key).into()); + return Err(format!( + "key {:#x} is not in omnilock config", + args.sender_key[i] + ) + .into()); } } }