Răsfoiți Sursa

Moved ethvm => vm

obscuren 11 ani în urmă
părinte
comite
20c742e474
16 a modificat fișierele cu 24 adăugiri și 23 ștergeri
  1. 6 6
      ethchain/state_transition.go
  2. 3 3
      ethpipe/pipe.go
  3. 0 0
      vm/.ethtest
  4. 1 1
      vm/address.go
  5. 3 2
      vm/asm.go
  6. 1 1
      vm/closure.go
  7. 1 1
      vm/common.go
  8. 1 1
      vm/debugger.go
  9. 1 1
      vm/environment.go
  10. 1 1
      vm/execution.go
  11. 1 1
      vm/stack.go
  12. 1 1
      vm/types.go
  13. 1 1
      vm/virtual_machine.go
  14. 1 1
      vm/vm.go
  15. 1 1
      vm/vm_debug.go
  16. 1 1
      vm/vm_test.go

+ 6 - 6
ethchain/state_transition.go

@@ -7,7 +7,7 @@ import (
 	"github.com/ethereum/eth-go/ethstate"
 	"github.com/ethereum/eth-go/ethtrie"
 	"github.com/ethereum/eth-go/ethutil"
-	"github.com/ethereum/eth-go/ethvm"
+	"github.com/ethereum/eth-go/vm"
 )
 
 /*
@@ -160,13 +160,13 @@ func (self *StateTransition) TransitionState() (err error) {
 	sender.Nonce += 1
 
 	// Transaction gas
-	if err = self.UseGas(ethvm.GasTx); err != nil {
+	if err = self.UseGas(vm.GasTx); err != nil {
 		return
 	}
 
 	// Pay data gas
 	dataPrice := big.NewInt(int64(len(self.data)))
-	dataPrice.Mul(dataPrice, ethvm.GasData)
+	dataPrice.Mul(dataPrice, vm.GasData)
 	if err = self.UseGas(dataPrice); err != nil {
 		return
 	}
@@ -261,11 +261,11 @@ func (self *StateTransition) Eval(msg *ethstate.Message, script []byte, context
 		transactor    = self.Sender()
 		state         = self.state
 		env           = NewEnv(state, self.tx, self.block)
-		callerClosure = ethvm.NewClosure(msg, transactor, context, script, self.gas, self.gasPrice)
+		callerClosure = vm.NewClosure(msg, transactor, context, script, self.gas, self.gasPrice)
 	)
 
-	//vm := ethvm.New(env, ethvm.Type(ethutil.Config.VmType))
-	vm := ethvm.New(env, ethvm.DebugVmTy)
+	//vm := vm.New(env, vm.Type(ethutil.Config.VmType))
+	vm := vm.New(env, vm.DebugVmTy)
 
 	ret, _, err = callerClosure.Call(vm, self.tx.Data)
 

+ 3 - 3
ethpipe/pipe.go

@@ -9,7 +9,7 @@ import (
 	"github.com/ethereum/eth-go/ethlog"
 	"github.com/ethereum/eth-go/ethstate"
 	"github.com/ethereum/eth-go/ethutil"
-	"github.com/ethereum/eth-go/ethvm"
+	"github.com/ethereum/eth-go/vm"
 )
 
 var logger = ethlog.NewLogger("PIPE")
@@ -58,9 +58,9 @@ func (self *Pipe) ExecuteObject(object *Object, data []byte, value, gas, price *
 
 	self.Vm.State = self.World().State().Copy()
 
-	vm := ethvm.New(NewEnv(self.Vm.State, block, value.BigInt(), initiator.Address()), ethvm.Type(ethutil.Config.VmType))
+	evm := vm.New(NewEnv(self.Vm.State, block, value.BigInt(), initiator.Address()), vm.Type(ethutil.Config.VmType))
 
-	msg := ethvm.NewExecution(vm, object.Address(), data, gas.BigInt(), price.BigInt(), value.BigInt())
+	msg := vm.NewExecution(evm, object.Address(), data, gas.BigInt(), price.BigInt(), value.BigInt())
 	ret, err := msg.Exec(object.Address(), initiator)
 
 	fmt.Println("returned from call", ret, err)

+ 0 - 0
ethvm/.ethtest → vm/.ethtest


+ 1 - 1
ethvm/address.go → vm/address.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"math/big"

+ 3 - 2
ethvm/asm.go → vm/asm.go

@@ -1,9 +1,10 @@
-package ethvm
+package vm
 
 import (
 	"fmt"
-	"github.com/ethereum/eth-go/ethutil"
 	"math/big"
+
+	"github.com/ethereum/eth-go/ethutil"
 )
 
 func Disassemble(script []byte) (asm []string) {

+ 1 - 1
ethvm/closure.go → vm/closure.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 // TODO Re write VM to use values instead of big integers?
 

+ 1 - 1
ethvm/common.go → vm/common.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"math/big"

+ 1 - 1
ethvm/debugger.go → vm/debugger.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import "github.com/ethereum/eth-go/ethstate"
 

+ 1 - 1
ethvm/environment.go → vm/environment.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"math/big"

+ 1 - 1
ethvm/execution.go → vm/execution.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"fmt"

+ 1 - 1
ethvm/stack.go → vm/stack.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"fmt"

+ 1 - 1
ethvm/types.go → vm/types.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"fmt"

+ 1 - 1
ethvm/virtual_machine.go → vm/virtual_machine.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 type VirtualMachine interface {
 	Env() Environment

+ 1 - 1
ethvm/vm.go → vm/vm.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"fmt"

+ 1 - 1
ethvm/vm_debug.go → vm/vm_debug.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"fmt"

+ 1 - 1
ethvm/vm_test.go → vm/vm_test.go

@@ -1,4 +1,4 @@
-package ethvm
+package vm
 
 import (
 	"bytes"