Skip to content

Commit

Permalink
Fix script not found
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed May 11, 2024
1 parent ea461f5 commit f436448
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ckb/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1995,7 +1995,10 @@ impl ChannelActorState {
let new_tx = TransactionBuilder::default()
.cell_deps(tx.cell_deps().clone())
.set_inputs(vec![input])
.outputs(vec![CellOutput::new_builder().capacity(100.pack()).build()])
.outputs(vec![CellOutput::new_builder()
.capacity(100.pack())
.lock(get_secp256k1_lock_script(b"whatever"))
.build()])
.outputs_data(vec![Default::default()])
.build();
dbg!("new tx: {:?}", &new_tx);
Expand Down Expand Up @@ -2876,7 +2879,9 @@ fn get_commitment_lock_script(args: &[u8]) -> Script {

// TODO: fill in the actual lock script.
fn get_secp256k1_lock_script(args: &[u8]) -> Script {
Script::new_builder().args(args.pack()).build()
// Just need a script that can be found by ckb to pass the test.
// So we use commitment lock script instead of a non-existing secp256k1 lock script.
get_commitment_lock_script(args)
}

fn get_commitment_lock_outpoint() -> OutPoint {
Expand Down

0 comments on commit f436448

Please sign in to comment.