Skip to content

Commit

Permalink
Fix tests for updated rust-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pool2win committed May 24, 2024
1 parent bf524b4 commit c81c191
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 96 deletions.
40 changes: 20 additions & 20 deletions lib/contracts/ark/single_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
],
outputs: [
{
policy: 'or(99@thresh(2,pk(@alice),pk(@asp)),'\
policy: 'or(thresh(2,pk(@alice),pk(@asp)),'\
'and(older(@timeout_period),pk(@alice_timelock)))', # <2>
amount: 49.998.sats
}
Expand All @@ -89,7 +89,7 @@
# ASP now sends the redeem transaction to Alice

# tag::initialise_payment_to_bob[]
# Alices sends a signed request to ASP for initiating a payment to Bob
# Alice sends a signed request to ASP for initiating a payment to Bob
# ASP creates a Redeem transaction for Bob
state_transition :initialise_payment_to_bob do
@pool_tx = transaction inputs: [
Expand Down Expand Up @@ -152,7 +152,7 @@
# Bob adds his signature to redeem tx
update_script_sig for_tx: @redeem_tx_for_bob,
at_index: 0,
with_script_sig: 'sig:@asp sig:@bob ""' # <1>
with_script_sig: '"" sig:@bob sig:@asp' # <1>
# Bob can redeem his coins
assert_mempool_accept @redeem_tx_for_bob
# Alice can no longer redeem her coins
Expand All @@ -165,14 +165,14 @@
add_csv_to_transaction @redeem_tx, index: 0, csv: @timeout_period
update_script_sig for_tx: @redeem_tx,
at_index: 0,
with_script_sig: 'sig:@asp sig:@alice ""' # <1>
with_script_sig: '"" sig:@alice sig:@asp' # <1>

broadcast @redeem_tx
confirm transaction: @redeem_tx

@spend_alice_coins = transaction inputs: [
{ tx: @redeem_tx, vout: 0,
script_sig: 'sig:@alice_timelock @alice_timelock 0x01', # <2>
script_sig: 'sig:@alice_timelock', # <2>
csv: @timeout_period }
],
outputs: [
Expand All @@ -185,21 +185,21 @@
end
# end::alice_redeems_coins_after_timeout[]

# tag::pay_alice_to_bob[]
# Publish pool transaction, paying Alice to Bob
run_transitions :setup,
:create_funding_tx,
:create_redeem_tx,
:broadcast_funding_tx,
:initialise_payment_to_bob,
:build_alice_forfeit_tx,
:publish_pool_tx, # <1>
:bob_redeems_coins
# end::pay_alice_to_bob[]

# tag::reset[]
node :reset
# end::reset[]
# # tag::pay_alice_to_bob[]
# # Publish pool transaction, paying Alice to Bob
# run_transitions :setup,
# :create_funding_tx,
# :create_redeem_tx,
# :broadcast_funding_tx,
# :initialise_payment_to_bob,
# :build_alice_forfeit_tx,
# :publish_pool_tx, # <1>
# :bob_redeems_coins
# # end::pay_alice_to_bob[]

# # tag::reset[]
# node :reset
# # end::reset[]

# tag::cancelled_payment[]
# Cancel the payment because ASP is not responsive
Expand Down
2 changes: 1 addition & 1 deletion lib/contracts/coinbase_with_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@spend_coinbase = transaction inputs: [
{ tx: @coinbase_with_policy,
vout: 0,
script_sig: 'sig:@bob sig:@alice' }
script_sig: '"" sig:@alice sig:@bob' }
],
outputs: [
{
Expand Down
92 changes: 17 additions & 75 deletions miniscript-cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c81c191

Please sign in to comment.