forked from TrueCloudLab/neoneo-go
emit: remove tailCall argument from AppCall
There is no TAILCALL opcode in NEO3.
This commit is contained in:
parent
73c82584a3
commit
c0147c76ac
3 changed files with 8 additions and 9 deletions
|
@ -1616,7 +1616,7 @@ func ScriptFromWitness(hash util.Uint160, witness *transaction.Witness) ([]byte,
|
|||
|
||||
if len(verification) == 0 {
|
||||
bb := io.NewBufBinWriter()
|
||||
emit.AppCall(bb.BinWriter, hash, false)
|
||||
emit.AppCall(bb.BinWriter, hash)
|
||||
verification = bb.Bytes()
|
||||
} else if h := witness.ScriptHash(); hash != h {
|
||||
return nil, errors.New("witness hash mismatch")
|
||||
|
|
|
@ -210,7 +210,7 @@ func CreateFunctionInvocationScript(contract util.Uint160, params Params) ([]byt
|
|||
}
|
||||
}
|
||||
|
||||
emit.AppCall(script.BinWriter, contract, false)
|
||||
emit.AppCall(script.BinWriter, contract)
|
||||
return script.Bytes(), nil
|
||||
}
|
||||
|
||||
|
@ -224,6 +224,6 @@ func CreateInvocationScript(contract util.Uint160, funcParams []Param) ([]byte,
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
emit.AppCall(script.BinWriter, contract, false)
|
||||
emit.AppCall(script.BinWriter, contract)
|
||||
return script.Bytes(), nil
|
||||
}
|
||||
|
|
|
@ -141,9 +141,8 @@ func Jmp(w *io.BinWriter, op opcode.Opcode, label uint16) {
|
|||
Instruction(w, op, buf)
|
||||
}
|
||||
|
||||
// AppCall emits an appcall, if tailCall is true, tailCall opcode will be
|
||||
// emitted instead.
|
||||
func AppCall(w *io.BinWriter, scriptHash util.Uint160, tailCall bool) {
|
||||
// AppCall emits call to provided contract.
|
||||
func AppCall(w *io.BinWriter, scriptHash util.Uint160) {
|
||||
Bytes(w, scriptHash.BytesBE())
|
||||
Syscall(w, "System.Contract.Call")
|
||||
}
|
||||
|
@ -152,21 +151,21 @@ func AppCall(w *io.BinWriter, scriptHash util.Uint160, tailCall bool) {
|
|||
func AppCallWithOperationAndArgs(w *io.BinWriter, scriptHash util.Uint160, operation string, args ...interface{}) {
|
||||
Array(w, args...)
|
||||
String(w, operation)
|
||||
AppCall(w, scriptHash, false)
|
||||
AppCall(w, scriptHash)
|
||||
}
|
||||
|
||||
// AppCallWithOperationAndData emits an appcall with the given operation and data.
|
||||
func AppCallWithOperationAndData(w *io.BinWriter, scriptHash util.Uint160, operation string, data []byte) {
|
||||
Bytes(w, data)
|
||||
String(w, operation)
|
||||
AppCall(w, scriptHash, false)
|
||||
AppCall(w, scriptHash)
|
||||
}
|
||||
|
||||
// AppCallWithOperation emits an appcall with the given operation.
|
||||
func AppCallWithOperation(w *io.BinWriter, scriptHash util.Uint160, operation string) {
|
||||
Bool(w, false)
|
||||
String(w, operation)
|
||||
AppCall(w, scriptHash, false)
|
||||
AppCall(w, scriptHash)
|
||||
}
|
||||
|
||||
func isInstructionJmp(op opcode.Opcode) bool {
|
||||
|
|
Loading…
Reference in a new issue