vm.go 789 Bytes
Newer Older
obscuren's avatar
obscuren committed
1
package vm
2

3
import "math/big"
4

obscuren's avatar
obscuren committed
5 6 7
// BIG FAT WARNING. THIS VM IS NOT YET IS USE!
// I want to get all VM tests pass first before updating this VM

8
type Vm struct {
9 10
	env   Environment
	err   error
obscuren's avatar
obscuren committed
11
	depth int
12 13
}

14 15 16 17 18 19
func New(env Environment, typ Type) VirtualMachine {
	switch typ {
	case DebugVmTy:
		return NewDebugVm(env)
	default:
		return &Vm{env: env}
20
	}
obscuren's avatar
obscuren committed
21 22
}

obscuren's avatar
obscuren committed
23
func (self *Vm) Run(me, caller ContextRef, code []byte, value, gas, price *big.Int, data []byte) (ret []byte, err error) {
obscuren's avatar
obscuren committed
24
	panic("not implemented")
25 26
}

27 28
func (self *Vm) Env() Environment {
	return self.env
29 30
}

31 32
func (self *Vm) Depth() int {
	return self.depth
obscuren's avatar
obscuren committed
33
}
34 35 36

func (self *Vm) Printf(format string, v ...interface{}) VirtualMachine { return self }
func (self *Vm) Endl() VirtualMachine                                  { return self }