Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shinigami Script Editor Playground #290

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

supreme2580
Copy link
Contributor

@supreme2580 supreme2580 commented Dec 27, 2024

  • resolves #
  • follows contribution guide
  • code change includes tests

Wrote the shinigami script execution logic in typescript to enable instant script execution and debugging in the shinigami script editor in shinigami.ts
Confirmed that results from the shinigami cairo implementation and the shinigami typescript implementation returns the same values

[DOES NOT USE CAIRO WASM]

Closes: #240

Copy link

vercel bot commented Dec 27, 2024

@supreme2580 is attempting to deploy a commit to the keep-starknet-strange Team on Vercel.

A member of the Team first needs to authorize it.

@b-j-roberts
Copy link
Contributor

I tried running locally, and changed the script a bit to result in an error, but I still got a "1" as the stack after running.

I changed the first OP_1 to OP_2.

@supreme2580
Copy link
Contributor Author

@b-j-roberts Hey boss, so what I did is for it to return 1 if the execution is successful and 0 if it is not
image
image
Screenshot 2025-01-27 at 11 02 37

@supreme2580
Copy link
Contributor Author

supreme2580 commented Jan 27, 2025

@b-j-roberts Also boss when if [0,0] should mean that the execution failed, I ran it on Bitcoin IDE OP_1 OP_2 or 1 2 and I got the same result as shinigami.ts

@b-j-roberts
Copy link
Contributor

The stack visualizer should probably show the entire stack after execution.

However, this is the script I was referring to running, which should be a failing script I believe:
image

@supreme2580
Copy link
Contributor Author

supreme2580 commented Jan 27, 2025

I believe that works when you use run.sh and it also works when you use the script editor
./scripts/run_script.sh debug "OP_1 OP_2 OP_ADD OP_3 OP_EQUAL OP_HASH160 OP_HASH160 OP_DATA_20 0xb157bee96d62f6855392b9920385a834c3113d9a OP_EQUAL"

Screenshot 2025-01-27 at 17 58 30

@supreme2580
Copy link
Contributor Author

show the entire stack after execution

Do you mean when you run it, it should show the entire stack, then when you debug it should go step by step?

@b-j-roberts
Copy link
Contributor

I believe that works when you use run.sh and it also works when you use the script editor ./scripts/run_script.sh debug "OP_1 OP_2 OP_ADD OP_3 OP_EQUAL OP_HASH160 OP_HASH160 OP_DATA_20 0xb157bee96d62f6855392b9920385a834c3113d9a OP_EQUAL"

Screenshot 2025-01-27 at 17 58 30

Yes, it works but if you change the script to ./scripts/run_script.sh debug "OP_2 OP_2 OP_ADD OP_3 OP_EQUAL OP_HASH160 OP_HASH160 OP_DATA_20 0xb157bee96d62f6855392b9920385a834c3113d9a OP_EQUAL" ( first OP_1 -> OP_2 ) it should return an error, but I got 1 on the stack after running on the frontend

@b-j-roberts
Copy link
Contributor

b-j-roberts commented Jan 27, 2025

Btw, I don't recommend merging main into your branch. Looks like there was some errors introduced on the run scripts which were merged in

@supreme2580
Copy link
Contributor Author

Oh... and I used results from run_script.sh to judge the results lol, what'd you recommend?

@b-j-roberts
Copy link
Contributor

Sorry, using run_script.sh should be good still. This script gives different results when running with the script and frontend shinigami though:
OP_2 OP_2 OP_ADD OP_3 OP_EQUAL OP_HASH160 OP_HASH160 OP_DATA_20 0xb157bee96d62f6855392b9920385a834c3113d9a OP_EQUAL

@supreme2580
Copy link
Contributor Author

Okay let me test this

@supreme2580
Copy link
Contributor Author

Yes I see, one value is missing, let me check that out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] add cairo-wasm support for Shinigami frontend
2 participants