Add `Roll` method to Stack that doesn't pop and push values and use it for
ROLL and ROT.
1.4M->1.5M 100K block import test before:
real 3m44,292s
user 5m43,494s
sys 0m34,741s
After:
real 3m40,449s
user 5m42,701s
sys 0m35,500s
Add `Swap` method to the Stack and use it for both SWAP and XSWAP. Avoid
element popping and pushing (and associated accounting costs).
1.4M->1.5M 100K block import test before:
real 3m51,885s
user 5m54,744s
sys 0m38,444s
After:
real 3m44,292s
user 5m43,494s
sys 0m34,741s
Script can return non-bool results that can still be converted to bool
according to the usual VM rules. Unfortunately Bool() panics if this
conversion fails which is OK for things done in vm.execute(), but certainly
not for VerifyWitnesses(), thus there is a need for TryBool() that will just
return an error in this case.
It gives access to the internal value's Value() which is essential for interop
functions that need to get something from InteropItems. And it also simplifies
some already existing code along the way.
The code that we have actually implements XTUCK and not TUCK. And it's a bit
broken, so fix it and add some tests. The most interesting one (that required
to touch stack code) is the one when we have 1 element on the stack and are
trying to tell XTUCK to push 2 elements deep.
* renamed test folders and fixed bug where wrong jump labels would be exectuted for rewrite.
* Added support for Osize (len(string)) and factored out the array tests
* Added current instruction number to VM prompt if program is loaded.
* added support for unary expressions.
* updated README of and sorted the help commands
* updated readme of the compiler
* bumped version -> 0.39.0
* changed vm commands to match more of the standard
* fixed Uint16 jmp bug in VM
* moved test to vm + fixed numnotequal bug
* fixed broken tests
* moved compiler tests to vm tests
* added basic for support + inc and dec stmts
* bumped version
* Virtual machine for the NEO blockhain.
* fixed big.Int numeric operation pointer issue.
* added appcall
* Added README for vm package.
* removed main.go
* started VM cli (prompt) integration
* added support for printing the stack.
* moved cli to vm package
* fixed vet errors
* updated readme
* added more test for VM and fixed some edge cases.
* bumped version -> 0.37.0