BlockstreamResearch / simplicity

Simplicity is a blockchain programming language designed as an alternative to Bitcoin script.
MIT License
305 stars 45 forks source link

Assert preconditions for execSimplicity #236

Closed roconnor-blockstream closed 4 months ago

roconnor-blockstream commented 5 months ago

Currently a false result in execSimplicity is ambigous. It either means a precondition failed, or it failed to complete its computation due to lack of memory or some other "transient" error.

But failing a preconditon is not "transient". Instead we will just assert the various precondtions hold and require that the caller ensure that the preconditions are satisfied.

We also add a new 'non-negative budget' precondition that was missing before.

roconnor-blockstream commented 5 months ago

Fixes #234.