clvm
clvm copied to clipboard
brun returns invalid argument exception. Different results on 2 machines.
Given the following file: passwordprotect.clsp
:
(mod (
password_hash
password
receive_puzzlehash
transaction_amount
)
(defconstant CREATE_COIN 51)
(if (= (sha256 password) password_hash)
; true - password was correct
(list
(list CREATE_COIN receive_puzzlehash transaction_amount)
)
; false - password was incorrect
(x "Bad password")
)
)
brun throws an error on my machine (windows 10, powershell:
brun '(a (q 2 (i (= (sha256 11) 5) (q 4 (c 2 (c 23 (c 47 ()))) ()) (q 8 (q . "Bad password"))) 1) (c (q . 51) 1))' "(0x9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 test 0xa11ce 1000)"
same brun command works on another machine (in the video tutorial and for another community member) :
This is due to how Powershell handles double-quotes: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_quoting_rules?view=powershell-7.2
well actually, I wouldnt consider this as resolved but as "workaround found" it is highly inconvenient in powershell with that
you'll need to file an issue with PowerShell to fix that, that's how they handle if double/single quotes are mixed
its not that I wouldnt do that. From experience, Microsoft does not give a damn. It only hurts the chir devs on windows i think. Its like shooting in the own knee.
Im running a virtual machine now to do that stuff. not the most comfortable way of doing things but meh.