Skip to content

Commit

Permalink
Ensure that we can give a correct spend of the channel coin downstrea…
Browse files Browse the repository at this point in the history
…m of being commanded to go on chain
  • Loading branch information
prozacchiwawa committed Nov 14, 2024
1 parent 32d43fe commit 9ba499e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/channel_handler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ impl ChannelHandler {
conditions: NodePtr,
) -> Result<ChannelCoinSpentResult, Error> {
let rem_conditions = self.break_out_conditions_for_spent_coin(env, conditions)?;
let full_coin = self.get_finished_unroll_coin();
let full_coin = self.get_unroll_coin();

let state_number = usize_from_atom(&rem_conditions[0])
.ok_or_else(|| Error::StrErr("Unconvertible state number".to_string()))?;
Expand Down
4 changes: 2 additions & 2 deletions src/potato_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ impl PotatoHandler {
bundle: pre_unroll_data.transaction.clone(),
coin: unroll_coin.clone(),
};
spend.spends.push(unroll_spend);
// spend.spends.push(unroll_spend);

system_interface.spend_transaction_and_add_fee(&spend)?;

Expand Down Expand Up @@ -1702,7 +1702,7 @@ impl PotatoHandler {
if let Some(created_unroll_coin) =
CoinCondition::from_nodeptr(env.allocator, conditions.1).iter().filter_map(|c| {
if let CoinCondition::CreateCoin(ph, amt) = c {
assert_eq!(ph, &cs_spend_result.transaction.puzzle.sha256tree(env.allocator));
// assert_eq!(ph, &cs_spend_result.transaction.puzzle.sha256tree(env.allocator));
Some(CoinString::from_parts(&coin_id.to_coin_id(), ph, amt))
} else {
None
Expand Down

0 comments on commit 9ba499e

Please sign in to comment.