aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/sqlvm/runtime/runtime.go
blob: ebb4d457938b2eb1587a55e2349400efa85e9e10 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package runtime

import (
    "github.com/dexon-foundation/dexon/core/vm"
    "github.com/dexon-foundation/dexon/core/vm/sqlvm/common"
)

// Run is runtime entrypoint.
func Run(stateDB vm.StateDB, ins []Instruction, registers []*Operand) (ret []byte, err error) {
    for _, in := range ins {
        opFunc := jumpTable[in.op]
        err = opFunc(&common.Context{}, in.input, registers, in.output)
        if err != nil {
            return nil, err
        }
    }
    // TODO: ret = ABIEncode(ins[len(ins)-1].output)
    return
}