emit: optimize Bool GAS cost

NOT is 1 byte shorter and 2048 times cheaper than CONVERT. Inspired by
neo-project/neo-vm#493.
This commit is contained in:
Roman Khimov 2022-10-25 13:08:33 +03:00
parent 4313b7f0c7
commit 5d43367082
7 changed files with 42 additions and 47 deletions

View file

@ -914,7 +914,7 @@ func TestRunWithHistoricState(t *testing.T) {
e.checkNextLine(t, "READY: loaded 36 instructions")
e.checkStack(t, []byte{1})
e.checkNextLine(t, "READY: loaded 36 instructions")
e.checkNextLineExact(t, "Error: at instruction 31 (SYSCALL): failed to invoke syscall 1381727586: called contract a00e3c2643a08a452d8b0bdd31849ae11a17c445 not found: key not found\n")
e.checkNextLineExact(t, "Error: at instruction 31 (SYSCALL): failed to invoke syscall 1381727586: called contract cd583ac7a1a4faef70d6e9f513bc988dde22f672 not found: key not found\n")
}
func TestEvents(t *testing.T) {
@ -939,7 +939,7 @@ func TestEvents(t *testing.T) {
}),
}),
}
e.checkNextLine(t, "READY: loaded 44 instructions")
e.checkNextLine(t, "READY: loaded 43 instructions")
e.checkStack(t, stackitem.Null{})
e.checkEvents(t, true, expectedEvent) // automatically printed after `run` command
e.checkEvents(t, false, expectedEvent) // printed after `events` command