Skip to content

Commit

Permalink
fix leap unlock tx
Browse files Browse the repository at this point in the history
  • Loading branch information
EthanYuan committed Aug 29, 2024
1 parent 9b42706 commit ade1b9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 22 deletions.
27 changes: 11 additions & 16 deletions aggregator/aggregator-main/src/branch_to_rgbpp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,34 +150,29 @@ impl Aggregator {
tx_hash.0.into(),
requests_in_witness.raw_data(),
);
let inbox_tx = match inbox_tx {
Ok(inbox_tx) => {
H256::from_slice(inbox_tx.as_bytes()).expect("unlock tx to H256")
let _ = match inbox_tx {
Ok(_) => {
self.store
.commit_branch_request(height)
.expect("commit branch request");
}
Err(e) => {
error!("{}", e.to_string());
continue;
}
};
match wait_for_tx_confirmation(
self.rgbpp_rpc_client.clone(),
H256(inbox_tx.0),
Duration::from_secs(30),
) {
Ok(_) => {
self.store
.commit_branch_request(height)
.expect("commit branch request");
}
Err(e) => error!("{}", e.to_string()),
}
}
}
}

let unlock_tx = self.rgbpp_tx_builder.create_unlock_tx();
let unlock_tx = match unlock_tx {
Ok(unlock_tx) => unlock_tx,
Ok(unlock_tx) => {
if H256(unlock_tx.0) == H256::default() {
continue;
}
unlock_tx
}
Err(e) => {
error!("{}", e.to_string());
continue;
Expand Down
8 changes: 2 additions & 6 deletions aggregator/util/rgbpp-tx/src/branch_to_rgbpp/unlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ impl RgbppTxBuilder {
self.get_rgbpp_queue_cell(self.rgbpp_queue_inbox_lock_key_path.clone())?;
info!(
"The queue inbox contains {} requests that need to be unlock.",
queue_cell_data.outbox().len()
queue_cell_data.inbox().len()
);
if queue_cell_data.outbox().is_empty() {
if queue_cell_data.inbox().is_empty() {
return Ok(H256::default());
}

Expand Down Expand Up @@ -161,10 +161,6 @@ impl RgbppTxBuilder {
// custodian lock script
let (custodian_lock_script_args, custodian_lock_key) =
get_sighash_lock_args_from_privkey(self.rgbpp_custodian_lock_key_path.clone())?;
info!(
"Custodian lock script args: {:?}",
custodian_lock_script_args
);
let custodian_lock_script = Script::new_builder()
.code_hash(SIGHASH_TYPE_HASH.pack())
.hash_type(ScriptHashType::Type.into())
Expand Down

0 comments on commit ade1b9e

Please sign in to comment.