Skip to content

Commit

Permalink
fix: fix ckb tx signing
Browse files Browse the repository at this point in the history
when there are multiple sighash inputs
  • Loading branch information
blckngm committed Dec 25, 2023
1 parent 54322b1 commit fd3fcc7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/relayer/src/chain/ckb4ibc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ impl Ckb4IbcChain {
return Ok((commitment_path, event, None));
}
let unsigned_tx = unsigned_tx.unwrap();
// Assuming all remaining inputs are sighash capacity inputs.
let first_sig_input_idx = unsigned_tx.inputs().len();
let msg_type = envelope.msg_type;
match self.complete_tx_with_secp256k1_change_and_envelope(
unsigned_tx,
Expand All @@ -515,9 +517,7 @@ impl Ckb4IbcChain {
&ScriptGroup {
script: Script::from(&self.tx_assembler_address()?),
group_type: ScriptGroupType::Lock,
// TODO: here should be more indices in case of more than one Secp256k1 cells
// have been filled in the transaction
input_indices: vec![last_input_idx],
input_indices: (first_sig_input_idx..=last_input_idx).collect(),
output_indices: vec![],
},
)
Expand Down

0 comments on commit fd3fcc7

Please sign in to comment.