clvm icon indicating copy to clipboard operation
clvm copied to clipboard

brun returns invalid argument exception. Different results on 2 machines.

Open forReason opened this issue 2 years ago • 4 comments

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)"

image

same brun command works on another machine (in the video tutorial and for another community member) :
paste

forReason avatar Jun 22 '22 12:06 forReason

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

trepca avatar Aug 23 '22 13:08 trepca

well actually, I wouldnt consider this as resolved but as "workaround found" it is highly inconvenient in powershell with that

forReason avatar Sep 05 '22 09:09 forReason

you'll need to file an issue with PowerShell to fix that, that's how they handle if double/single quotes are mixed

trepca avatar Sep 26 '22 12:09 trepca

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.

forReason avatar Nov 01 '22 16:11 forReason