mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 23:33:37 +00:00
parent
0a09a20900
commit
35b30ccfdf
6 changed files with 3 additions and 15 deletions
|
@ -51,7 +51,7 @@ func createGenesisBlock(cfg config.ProtocolConfiguration) (*block.Block, error)
|
||||||
NextConsensus: nextConsensus,
|
NextConsensus: nextConsensus,
|
||||||
Script: transaction.Witness{
|
Script: transaction.Witness{
|
||||||
InvocationScript: []byte{},
|
InvocationScript: []byte{},
|
||||||
VerificationScript: []byte{byte(opcode.OLDPUSH1)},
|
VerificationScript: []byte{byte(opcode.PUSH1)},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
pkg/rpc/server/testdata/testblocks.acc
vendored
BIN
pkg/rpc/server/testdata/testblocks.acc
vendored
Binary file not shown.
|
@ -77,12 +77,6 @@ func (c *Context) Next() (opcode.Opcode, []byte, error) {
|
||||||
|
|
||||||
var numtoread int
|
var numtoread int
|
||||||
switch instr {
|
switch instr {
|
||||||
case opcode.OLDPUSH1:
|
|
||||||
// OLDPUSH1 is used during transition to NEO3 in verification scripts.
|
|
||||||
// FIXME remove #927
|
|
||||||
if len(c.prog) == 1 {
|
|
||||||
return opcode.PUSH1, nil, nil
|
|
||||||
}
|
|
||||||
case opcode.PUSHDATA1:
|
case opcode.PUSHDATA1:
|
||||||
if c.nextip >= len(c.prog) {
|
if c.nextip >= len(c.prog) {
|
||||||
err = errNoInstParam
|
err = errNoInstParam
|
||||||
|
|
|
@ -135,12 +135,8 @@ func testFile(t *testing.T, filename string) {
|
||||||
require.NoErrorf(t, json.Unmarshal(data, ut), "file: %s", filename)
|
require.NoErrorf(t, json.Unmarshal(data, ut), "file: %s", filename)
|
||||||
|
|
||||||
t.Run(ut.Category+":"+ut.Name, func(t *testing.T) {
|
t.Run(ut.Category+":"+ut.Name, func(t *testing.T) {
|
||||||
isRot := strings.HasSuffix(filename, "ROT.json")
|
|
||||||
for i := range ut.Tests {
|
for i := range ut.Tests {
|
||||||
test := ut.Tests[i]
|
test := ut.Tests[i]
|
||||||
if isRot && test.Name == "Without push" {
|
|
||||||
return // FIXME #927 single ROT is interpreted as PUSH1
|
|
||||||
}
|
|
||||||
t.Run(ut.Tests[i].Name, func(t *testing.T) {
|
t.Run(ut.Tests[i].Name, func(t *testing.T) {
|
||||||
prog := []byte(test.Script)
|
prog := []byte(test.Script)
|
||||||
vm := load(prog)
|
vm := load(prog)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package opcode
|
package opcode
|
||||||
|
|
||||||
//go:generate stringer -type=Opcode
|
//go:generate stringer -type=Opcode -linecomment
|
||||||
|
|
||||||
// Opcode represents a single operation code for the NEO virtual machine.
|
// Opcode represents a single operation code for the NEO virtual machine.
|
||||||
type Opcode byte
|
type Opcode byte
|
||||||
|
@ -87,7 +87,6 @@ const (
|
||||||
TUCK Opcode = 0x4E
|
TUCK Opcode = 0x4E
|
||||||
SWAP Opcode = 0x50
|
SWAP Opcode = 0x50
|
||||||
ROT Opcode = 0x51
|
ROT Opcode = 0x51
|
||||||
OLDPUSH1 Opcode = 0x51 // FIXME remove #927
|
|
||||||
ROLL Opcode = 0x52
|
ROLL Opcode = 0x52
|
||||||
REVERSE3 Opcode = 0x53
|
REVERSE3 Opcode = 0x53
|
||||||
REVERSE4 Opcode = 0x54
|
REVERSE4 Opcode = 0x54
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Code generated by "stringer -type Opcode -linecomment"; DO NOT EDIT.
|
// Code generated by "stringer -type=Opcode -linecomment"; DO NOT EDIT.
|
||||||
|
|
||||||
package opcode
|
package opcode
|
||||||
|
|
||||||
|
@ -77,7 +77,6 @@ func _() {
|
||||||
_ = x[TUCK-78]
|
_ = x[TUCK-78]
|
||||||
_ = x[SWAP-80]
|
_ = x[SWAP-80]
|
||||||
_ = x[ROT-81]
|
_ = x[ROT-81]
|
||||||
_ = x[OLDPUSH1-81]
|
|
||||||
_ = x[ROLL-82]
|
_ = x[ROLL-82]
|
||||||
_ = x[REVERSE3-83]
|
_ = x[REVERSE3-83]
|
||||||
_ = x[REVERSE4-84]
|
_ = x[REVERSE4-84]
|
||||||
|
|
Loading…
Reference in a new issue