Skip to content

Commit 205c936

Browse files
author
Liu Chuankai
committed
fix: 🐛 fix compile error after rebase master branch
1 parent 8710343 commit 205c936

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

examples/transfer_from_opentx.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ fn main() -> Result<(), Box<dyn StdErr>> {
266266
Commands::SignOpenTx(args) => {
267267
let tx_info: TxInfo = serde_json::from_slice(&fs::read(&args.tx_file)?)?;
268268
let tx = Transaction::from(tx_info.tx.inner).into_view();
269-
let keys = args
269+
let keys: Vec<secp256k1::SecretKey> = args
270270
.sender_key
271271
.iter()
272272
.map(|sender_key| {
@@ -276,7 +276,7 @@ fn main() -> Result<(), Box<dyn StdErr>> {
276276
})
277277
.collect();
278278
if tx_info.omnilock_config.is_pubkey_hash() || tx_info.omnilock_config.is_ethereum() {
279-
for key in &keys {
279+
for (i, key) in keys.iter().enumerate() {
280280
let pubkey = secp256k1::PublicKey::from_secret_key(&SECP256K1, key);
281281
let hash160 = match tx_info.omnilock_config.id().flag() {
282282
IdentityFlag::PubkeyHash => {
@@ -288,7 +288,11 @@ fn main() -> Result<(), Box<dyn StdErr>> {
288288
_ => unreachable!(),
289289
};
290290
if tx_info.omnilock_config.id().auth_content().as_bytes() != hash160 {
291-
return Err(format!("key {:#x} is not in omnilock config", key).into());
291+
return Err(format!(
292+
"key {:#x} is not in omnilock config",
293+
args.sender_key[i]
294+
)
295+
.into());
292296
}
293297
}
294298
}

0 commit comments

Comments
 (0)