vm: provide writer in PrintOps()

Make it more flexible and testable. Fallback to using
stdout if no writer is provided.
This commit is contained in:
Evgenii Stratonikov 2020-12-01 16:52:23 +03:00
parent 9a4183abb9
commit 2f39701d76
4 changed files with 10 additions and 6 deletions

View file

@ -225,8 +225,6 @@ func TestISTYPE(t *testing.T) {
func testCONVERT(to stackitem.Type, item, res stackitem.Item) func(t *testing.T) {
return func(t *testing.T) {
prog := []byte{byte(opcode.CONVERT), byte(to)}
v := load(prog)
v.PrintOps()
runWithArgs(t, prog, res, item)
}
}