CashScript / cashscript

⚖️ Easily write and interact with Bitcoin Cash smart contracts
https://cashscript.org
MIT License
111 stars 77 forks source link

Add extended debugging tools #174

Closed mainnet-pat closed 7 months ago

mainnet-pat commented 7 months ago

Hey guys, was nice to chat with you today and to present my work. I am glad, that you liked it!

Sending over the PR.

vercel[bot] commented 7 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
cashscript ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2023 9:18am
rkalis commented 7 months ago

Mathieu, Pat and I went over the buildTemplate function today.

Here's some notes from the call

Then we also need to do some refactoring of the template generation, mostly because the function is 350 lines of code with a lot of nesting. But before doing significant refactors, it is probably good to double check / extend test coverage so we don't break stuff.

@mainnet-pat if you could write down some areas in the code where you think it would benefit from more tests, that would be great. Then Mathieu and I can work on implementing the tests and refactoring the code.

We can release this functionality in a next release already, but we need to fix up these points before a full release.

mainnet-pat commented 7 months ago

Hey guys, I have refactored buildTemplate somewhat. There is issue with supporting p2sh32 - BCH_SPEC target does not support it, BCH_2023_05 does, but it fails token validation, which BCH_SPEC is good with. Until this libauth internal issue is not resolved I default the template to evaluate the transactions under BCH_SPEC and p2sh20.

rkalis commented 7 months ago

Some notes for later refactoring (doesn't need to be addressed now, but just so we don't forget):