compiler: update x/tools package

Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgeniy Stratonikov 2021-12-02 17:44:53 +03:00
parent e7a0ecb349
commit 9871dc8f5a
22 changed files with 235 additions and 140 deletions

View file

@ -167,6 +167,7 @@ func (e *executor) checkSlot(t *testing.T, items ...interface{}) {
}
func TestLoad(t *testing.T) {
t.Skip()
script := []byte{byte(opcode.PUSH3), byte(opcode.PUSH4), byte(opcode.ADD)}
t.Run("loadhex", func(t *testing.T) {
e := newTestVMCLI(t)
@ -208,6 +209,9 @@ func TestLoad(t *testing.T) {
filenameErr := filepath.Join(tmpDir, "vmtestcontract_err.go")
require.NoError(t, ioutil.WriteFile(filenameErr, []byte(src+"invalid_token"), os.ModePerm))
filenameErr = "'" + filenameErr + "'"
goMod := []byte(`module test.example/vmcli
go 1.15`)
require.NoError(t, ioutil.WriteFile(filepath.Join(tmpDir, "go.mod"), goMod, os.ModePerm))
e := newTestVMCLI(t)
e.runProg(t,
@ -232,6 +236,15 @@ func TestLoad(t *testing.T) {
filename := filepath.Join(tmpDir, "vmtestcontract.go")
require.NoError(t, ioutil.WriteFile(filename, []byte(srcAllowNotify), os.ModePerm))
filename = "'" + filename + "'"
wd, err := os.Getwd()
require.NoError(t, err)
goMod := []byte(`module test.example/kek
require (
github.com/nspcc-dev/neo-go v0.0.0
)
replace github.com/nspcc-dev/neo-go => ` + filepath.Join(wd, "../../..") + `
go 1.15`)
require.NoError(t, ioutil.WriteFile(filepath.Join(tmpDir, "go.mod"), goMod, os.ModePerm))
e := newTestVMCLI(t)
e.runProg(t,