Skip to content

Commit

Permalink
Revert clsp diagnotics
Browse files Browse the repository at this point in the history
  • Loading branch information
prozacchiwawa committed Nov 25, 2024
1 parent 67c7983 commit 2402f4f
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 22 deletions.
23 changes: 11 additions & 12 deletions clsp/calpoker_generate.clinc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
(import std.append)
(import std.relops)
(import std.list_compare)
(import std.print)
(import handcalc exposing handcalc)
(import onchain.calpoker.onehandcalc exposing onehandcalc)
(import onchain.game_codes)
Expand All @@ -30,14 +29,14 @@
; makes a move using entropy
(defun calpoker_alice_driver_a (local_move amount split max_move_size entropy)
(assign
preimage (print "alice driver a" (substr entropy 0 16))
preimage (substr entropy 0 16)
image (sha256 preimage)
(list
image
pokerb
pokerb_hash
image
997
16
0
(curry calpoker_alice_driver_b preimage image)
0
Expand All @@ -49,7 +48,7 @@
; move is bob's seed
; immediately sends a message giving Alice's seed
(defun calpoker_alice_driver_b (PREIMAGE IMAGE amount state_unused move validation_info_hash max_move_size split)
(list MAKE_MOVE (make_cards_readable (print "alice driver b" (sha256 PREIMAGE move amount)))
(list MAKE_MOVE (make_cards_readable (sha256 PREIMAGE move amount))
(curry calpoker_alice_driver_c PREIMAGE move) PREIMAGE)
)

Expand All @@ -64,7 +63,7 @@
; move is alice's reveal of her card generating seed and her commit to which cards she's picking
(defun calpoker_alice_driver_c (PREIMAGE BOB_SEED local_move amount split max_move_size entropy)
(assign
cards (make_cards (sha256 PREIMAGE BOB_SEED (print "alice driver c" amount)))
cards (make_cards (sha256 PREIMAGE BOB_SEED amount))
my_picks (bitify local_move)
salt (substr entropy 0 16)
new_commit (sha256 (concat salt my_picks))
Expand All @@ -73,7 +72,7 @@
pokerd
pokerd_hash
(list cards new_commit)
2
1
0
(curry calpoker_alice_driver_d salt my_picks)
0
Expand Down Expand Up @@ -103,7 +102,7 @@
(defun calpoker_alice_driver_d (MY_SALT MY_PICKS amount
(@ state (cards my_commit)) move validation_program_hash max_move_size split)
(assign
(my_cards_me my_cards_bob) (print "alice driver d" (split_cards MY_PICKS (f cards)))
(my_cards_me my_cards_bob) (split_cards MY_PICKS (f cards))
(bob_cards_bob bob_cards_me) (split_cards move (f (r cards)))
my_all_cards (map make_card (append my_cards_me bob_cards_me))
bob_all_cards (map make_card (append bob_cards_bob my_cards_bob))
Expand All @@ -124,14 +123,14 @@
; state is empty
; move is alice commit to a salted word
(defun calpoker_bob_driver_a (amount state move validation_program_hash max_move_size split)
(print "bob driver a" (list MAKE_MOVE 0 (curry calpoker_bob_driver_b move) 0))
(list MAKE_MOVE 0 (curry calpoker_bob_driver_b move) 0)
)

; state is alice_commit
; move is bob_seed
(defun calpoker_bob_driver_b (@ args (ALICE_COMMIT local_move amount split max_move_size entropy))
(assign
seed (print "bob driver b" (substr entropy 0 16))
seed (substr entropy 0 16)
(list
seed
pokerc
Expand All @@ -158,7 +157,7 @@
(defun calpoker_bob_driver_c (BOB_SEED amount state move validation_program_hash max_move_size split)
(assign
(alice_cards bob_cards)
(make_cards (print "bob driver c" (sha256 (substr move 0 16) BOB_SEED amount)))
(make_cards (sha256 (substr move 0 16) BOB_SEED amount))

readable_bob_cards
(make_readable_card_descriptions bob_cards)
Expand Down Expand Up @@ -187,7 +186,7 @@
; move is Bob's picks
(defun calpoker_bob_driver_d (ALICE_CARDS BOB_CARDS ALICE_COMMIT_2 local_move amount)
(assign
my_move (print "bob driver d" (bitify local_move))
my_move (bitify local_move)
(list
my_move
pokere
Expand All @@ -207,7 +206,7 @@
(defun calpoker_bob_driver_e (amount (@ state (bob_selects (alice_cards bob_cards) alice_commit_2)) move
validation_program_hash max_move_size split)
(assign
alice_selects (print "bob driver e" (substr move 16 (strlen move)))
alice_selects (substr move 16 (strlen move))
(alice_cards_alice alice_cards_bob) (split_cards alice_selects alice_cards)
(bob_cards_bob bob_cards_alice) (split_cards bob_selects bob_cards)
alice_all_cards (map make_card (append alice_cards_alice bob_cards_alice))
Expand Down
2 changes: 1 addition & 1 deletion clsp/calpoker_include_calpoker_factory.hex

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clsp/calpoker_include_calpoker_factory_hash.hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a0ead214cdaaada3c3a83d2ecbc2cbdff73c0027c33e84e09ecc6d5c250ee8ac2a
a024e6d61c722329f072f49807b92a92137007a48efa8990a8a8e892a07302a60c
2 changes: 1 addition & 1 deletion clsp/calpoker_include_calpoker_template.hex

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clsp/calpoker_include_calpoker_template_hash.hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a05b4ac0a8a8ef5b2739b39dd66548401e319bf5f679c2c3c3e8d6ac75cdfb0d1d
a0a67bd98df995843ce7455e32c980b1313f06f9095c4ebd3d93ee2225aed3b480
10 changes: 5 additions & 5 deletions clsp/onchain/referee.clsp
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,23 @@
; move
(assign
(new_move new_validation_info_hash new_mover_share new_max_move_size mover_puzzle solution) args
new_puzzle_hash (curry_hashes MOD_HASH (shatree (print "curried args" (list WAITER_PUZZLE_HASH MOVER_PUZZLE_HASH TIMEOUT
new_puzzle_hash (curry_hashes MOD_HASH (shatree (list WAITER_PUZZLE_HASH MOVER_PUZZLE_HASH TIMEOUT
AMOUNT MOD_HASH NONCE new_move new_max_move_size new_validation_info_hash new_mover_share
VALIDATION_INFO_HASH))))
VALIDATION_INFO_HASH)))
conditions (a mover_puzzle solution)
(assert
(print "assert1" VALIDATION_INFO_HASH)
(print (list "assert2" new_move MAX_MOVE_SIZE) (<= (strlen new_move) MAX_MOVE_SIZE))
(print (list "assert2" MOVE MAX_MOVE_SIZE) (<= (strlen MOVE) MAX_MOVE_SIZE))
(print "assert3" (<= new_mover_share AMOUNT))
(print "assert4" (>= new_mover_share 0))
(print "assert5" (logior (not new_validation_info_hash) (= 32 (strlen new_validation_info_hash))))
(print (list "assert6" MOVER_PUZZLE_HASH mover_puzzle) (= MOVER_PUZZLE_HASH (shatree mover_puzzle)))
(print "assert6" (= MOVER_PUZZLE_HASH (shatree mover_puzzle)))
; Check that the child output is made
(print "assert7" (match
(lambda ((& new_puzzle_hash AMOUNT) (condname arg1 arg2))
(logand (= condname CREATE_COIN) (= arg1 new_puzzle_hash) (= arg2 AMOUNT))
)
(print (list "the conditions" new_puzzle_hash) conditions)
conditions
))
(li (list REMARK new_move new_validation_info_hash new_mover_share new_max_move_size)
(list ASSERT_BEFORE_HEIGHT_RELATIVE TIMEOUT) &rest conditions)
Expand Down
2 changes: 1 addition & 1 deletion clsp/onchain/referee.hex
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ff02ffff01ff02ffff03ffff20ff0780ffff01ff02ffff01ff04ffff04ffff0152ffff04ff2dffff01808080ffff04ffff03ff8217fdffff04ffff0133ffff04ff09ffff04ff8217fdffff0180808080ffff04ffff0101ffff01808080ffff04ffff03ffff11ff5dff8217fd80ffff04ffff0133ffff04ff15ffff04ffff11ff5dff8217fd80ffff0180808080ffff04ffff0101ffff01808080ffff0180808080ff0180ffff01ff02ffff01ff02ffff03ffff07ffff05ffff06ff07808080ffff01ff02ffff01ff02ff2affff04ff02ffff04ffff06ff0180ffff04ff07ff8080808080ff0180ffff01ff02ffff01ff02ff16ffff04ff02ffff04ffff06ff0180ffff04ff07ff8080808080ff018080ff0180ff018080ff0180ffff04ffff01ffffffff02ffff03ff05ffff01ff02ffff01ff04ffff05ff0580ffff02ff10ffff04ff02ffff04ffff06ff0580ffff04ff0bff808080808080ff0180ffff01ff02ffff010bff018080ff0180ffff02ffff03ff05ffff01ff02ffff01ff0bffff06ffff06ffff01ffffa04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459aa09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ffa102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222a102a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c58080ffff02ff14ffff04ff02ffff04ffff05ff0580ffff04ffff02ff28ffff04ff02ffff04ffff06ff0580ff80808080ff808080808080ff0180ffff01ff02ffff01ff06ffff05ffff01ffffa04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459aa09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ffa102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222a102a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c58080ff018080ff0180ff0bffff01a102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222ffff02ff14ffff04ff02ffff04ff05ffff04ffff02ff28ffff04ff02ffff04ff07ff80808080ff808080808080ffff0bffff0102ffff0bffff0102ffff01a09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ff0580ffff0bffff0102ff0bffff01a04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a8080ffff02ffff03ff0bffff01ff02ffff01ff02ffff03ffff02ff05ffff04ffff05ff0b80ffff01808080ffff01ff02ffff01ff05ff0b80ff0180ffff01ff02ffff01ff02ff2cffff04ff02ffff04ff05ffff04ffff06ff0b80ff8080808080ff018080ff0180ff0180ffff01ff02ffff01ff0180ff018080ff0180ff02ffff03ffff22ffff0187247072696e7424ff05ff0b80ffff01ff02ffff010bff0180ffff01ff02ffff010bff018080ff0180ffffff02ffff03ffff07ff0580ffff01ff02ffff01ff0bffff0102ffff02ff12ffff04ff02ffff04ffff05ff0580ff80808080ffff02ff12ffff04ff02ffff04ffff06ff0580ff8080808080ff0180ffff01ff02ffff01ff0bffff0101ff0580ff018080ff0180ffff02ff3affff04ff02ffff04ff03ffff04ffff02ff12ffff04ff02ffff04ff2bff80808080ff8080808080ff02ffff03ffff09ff21ffff02ff12ffff04ff02ffff04ff8200b5ff8080808080ffff01ff02ffff01ff02ffff03ffff09ff8300bff1ffff0bff0bffff02ff12ffff04ff02ffff04ff25ff808080808080ffff01ff02ffff01ff04ffff04ffff0101ffff018080ffff02ff10ffff04ff02ffff04ffff02ff55ffff04ff0bff098080ffff04ffff02ff8200b5ff82017580ff808080808080ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ffff02ff2effff04ff02ffff04ff03ffff04ffff02ff38ffff04ff02ffff04ff820179ffff04ffff02ff12ffff04ff02ffff04ffff02ff3cffff04ff02ffff04ffff018c637572726965642061726773ffff04ffff04ff29ffff04ff11ffff04ff59ffff04ff8200b9ffff04ff820179ffff04ff8202f9ffff04ff13ffff04ff8200bbffff04ff2bffff04ff5bffff04ff8217f9ff808080808080808080808080ff8080808080ff80808080ff8080808080ffff04ffff02ff82017bff8202fb80ff808080808080ffff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727431ffff04ff822ff1ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff04ffff018761737365727432ffff04ff25ffff04ff8217f1ffff0180808080ffff04ffff20ffff15ffff0dff2580ff8217f18080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727433ffff04ffff20ffff15ff8200b5ff8201718080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727434ffff04ffff20ffff15ffff0180ff8200b58080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727435ffff04ffff19ffff20ff5580ffff09ffff0120ffff0dff55808080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff04ffff018761737365727436ffff04ff21ffff04ff8202f5ffff0180808080ffff04ffff09ff21ffff02ff12ffff04ff02ffff04ff8202f5ff8080808080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727437ffff04ffff02ff2cffff04ff02ffff04ffff04ffff0102ffff04ffff04ffff0101ffff04ffff0102ffff04ffff04ffff0101ff3e80ffff04ffff04ffff0104ffff04ffff04ffff0101ff0280ffff04ffff0101ff80808080ff8080808080ffff04ffff04ffff0104ffff04ffff04ffff0101ffff04ff0bffff04ff820171ffff0180808080ffff04ffff0101ffff0180808080ffff0180808080ffff04ffff02ff3cffff04ff02ffff04ffff04ffff018e74686520636f6e646974696f6e73ffff04ff0bffff01808080ffff04ff17ff8080808080ff8080808080ff8080808080ffff01ff02ffff01ff04ffff04ffff0101ffff04ff25ffff04ff55ffff04ff8200b5ffff04ff820175ffff01808080808080ffff04ffff04ffff0156ffff04ff8200b1ffff01808080ff178080ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff18ffff09ff13ffff013380ffff09ff2bff0980ffff09ff5bff158080ff018080
ff02ffff01ff02ffff03ffff20ff0780ffff01ff02ffff01ff04ffff04ffff0152ffff04ff2dffff01808080ffff04ffff03ff8217fdffff04ffff0133ffff04ff09ffff04ff8217fdffff0180808080ffff04ffff0101ffff01808080ffff04ffff03ffff11ff5dff8217fd80ffff04ffff0133ffff04ff15ffff04ffff11ff5dff8217fd80ffff0180808080ffff04ffff0101ffff01808080ffff0180808080ff0180ffff01ff02ffff01ff02ffff03ffff07ffff05ffff06ff07808080ffff01ff02ffff01ff02ff2affff04ff02ffff04ffff06ff0180ffff04ff07ff8080808080ff0180ffff01ff02ffff01ff02ff16ffff04ff02ffff04ffff06ff0180ffff04ff07ff8080808080ff018080ff0180ff018080ff0180ffff04ffff01ffffffff02ffff03ff05ffff01ff02ffff01ff04ffff05ff0580ffff02ff10ffff04ff02ffff04ffff06ff0580ffff04ff0bff808080808080ff0180ffff01ff02ffff010bff018080ff0180ffff02ffff03ff05ffff01ff02ffff01ff0bffff06ffff06ffff01ffffa04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459aa09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ffa102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222a102a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c58080ffff02ff14ffff04ff02ffff04ffff05ff0580ffff04ffff02ff28ffff04ff02ffff04ffff06ff0580ff80808080ff808080808080ff0180ffff01ff02ffff01ff06ffff05ffff01ffffa04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459aa09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ffa102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222a102a8d5dd63fba471ebcb1f3e8f7c1e1879b7152a6e7298a91ce119a63400ade7c58080ff018080ff0180ff0bffff01a102a12871fee210fb8619291eaea194581cbd2531e4b23759d225f6806923f63222ffff02ff14ffff04ff02ffff04ff05ffff04ffff02ff28ffff04ff02ffff04ff07ff80808080ff808080808080ffff0bffff0102ffff0bffff0102ffff01a09dcf97a184f32623d11a73124ceb99a5709b083721e878a16d78f596718ba7b2ff0580ffff0bffff0102ff0bffff01a04bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a8080ffff02ffff03ff0bffff01ff02ffff01ff02ffff03ffff02ff05ffff04ffff05ff0b80ffff01808080ffff01ff02ffff01ff05ff0b80ff0180ffff01ff02ffff01ff02ff2cffff04ff02ffff04ff05ffff04ffff06ff0b80ff8080808080ff018080ff0180ff0180ffff01ff02ffff01ff0180ff018080ff0180ff02ffff03ffff22ffff0187247072696e7424ff05ff0b80ffff01ff02ffff010bff0180ffff01ff02ffff010bff018080ff0180ffffff02ffff03ffff07ff0580ffff01ff02ffff01ff0bffff0102ffff02ff12ffff04ff02ffff04ffff05ff0580ff80808080ffff02ff12ffff04ff02ffff04ffff06ff0580ff8080808080ff0180ffff01ff02ffff01ff0bffff0101ff0580ff018080ff0180ffff02ff3affff04ff02ffff04ff03ffff04ffff02ff12ffff04ff02ffff04ff2bff80808080ff8080808080ff02ffff03ffff09ff21ffff02ff12ffff04ff02ffff04ff8200b5ff8080808080ffff01ff02ffff01ff02ffff03ffff09ff8300bff1ffff0bff0bffff02ff12ffff04ff02ffff04ff25ff808080808080ffff01ff02ffff01ff04ffff04ffff0101ffff018080ffff02ff10ffff04ff02ffff04ffff02ff55ffff04ff0bff098080ffff04ffff02ff8200b5ff82017580ff808080808080ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ffff02ff2effff04ff02ffff04ff03ffff04ffff02ff38ffff04ff02ffff04ff820179ffff04ffff02ff12ffff04ff02ffff04ffff04ff29ffff04ff11ffff04ff59ffff04ff8200b9ffff04ff820179ffff04ff8202f9ffff04ff13ffff04ff8200bbffff04ff2bffff04ff5bffff04ff8217f9ff808080808080808080808080ff80808080ff8080808080ffff04ffff02ff82017bff8202fb80ff808080808080ffff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727431ffff04ff822ff1ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff04ffff018761737365727432ffff04ff820bf1ffff04ff8217f1ffff0180808080ffff04ffff20ffff15ffff0dff820bf180ff8217f18080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727433ffff04ffff20ffff15ff8200b5ff8201718080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727434ffff04ffff20ffff15ffff0180ff8200b58080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727435ffff04ffff19ffff20ff5580ffff09ffff0120ffff0dff55808080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727436ffff04ffff09ff21ffff02ff12ffff04ff02ffff04ff8202f5ff8080808080ff8080808080ffff01ff02ffff01ff02ffff03ffff02ff3cffff04ff02ffff04ffff018761737365727437ffff04ffff02ff2cffff04ff02ffff04ffff04ffff0102ffff04ffff04ffff0101ffff04ffff0102ffff04ffff04ffff0101ff3e80ffff04ffff04ffff0104ffff04ffff04ffff0101ff0280ffff04ffff0101ff80808080ff8080808080ffff04ffff04ffff0104ffff04ffff04ffff0101ffff04ff0bffff04ff820171ffff0180808080ffff04ffff0101ffff0180808080ffff0180808080ffff04ff17ff8080808080ff8080808080ffff01ff02ffff01ff04ffff04ffff0101ffff04ff25ffff04ff55ffff04ff8200b5ffff04ff820175ffff01808080808080ffff04ffff04ffff0156ffff04ff8200b1ffff01808080ff178080ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff0180ffff01ff02ffff01ff0880ff018080ff0180ff18ffff09ff13ffff013380ffff09ff2bff0980ffff09ff5bff158080ff018080

0 comments on commit 2402f4f

Please sign in to comment.