aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-10-31 21:43:14 +0800
committerobscuren <geffobscura@gmail.com>2014-10-31 21:43:14 +0800
commitaf8f5f0b69f1c359991d12c7708804fe8dd1f944 (patch)
treedd3d5bea8d57037a2d32fae86c4ba7fcc9161b16 /cmd
parent0ed1a8b50a9b9726cd57a2731d0405f6949c6188 (diff)
downloadgo-tangerine-af8f5f0b69f1c359991d12c7708804fe8dd1f944.tar.gz
go-tangerine-af8f5f0b69f1c359991d12c7708804fe8dd1f944.tar.zst
go-tangerine-af8f5f0b69f1c359991d12c7708804fe8dd1f944.zip
ethstate => state
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mist/debugger.go20
-rw-r--r--cmd/mist/ext_app.go8
-rw-r--r--cmd/mist/html_container.go4
-rw-r--r--cmd/mist/qml_container.go4
-rw-r--r--cmd/mist/ui_lib.go4
-rw-r--r--cmd/utils/vm_env.go28
6 files changed, 34 insertions, 34 deletions
diff --git a/cmd/mist/debugger.go b/cmd/mist/debugger.go
index fadc241ff..3fd48eec6 100644
--- a/cmd/mist/debugger.go
+++ b/cmd/mist/debugger.go
@@ -26,8 +26,8 @@ import (
"github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/cmd/utils"
- "github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
"gopkg.in/qml.v1"
)
@@ -40,7 +40,7 @@ type DebuggerWindow struct {
vm *vm.DebugVm
Db *Debugger
- state *ethstate.State
+ state *state.State
}
func NewDebuggerWindow(lib *UiLib) *DebuggerWindow {
@@ -141,17 +141,17 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
keyPair = self.lib.eth.KeyManager().KeyPair()
)
- state := self.lib.eth.StateManager().TransState()
+ statedb := self.lib.eth.StateManager().TransState()
account := self.lib.eth.StateManager().TransState().GetAccount(keyPair.Address())
- contract := ethstate.NewStateObject([]byte{0})
+ contract := statedb.NewStateObject([]byte{0})
contract.SetBalance(value)
self.SetAsm(script)
block := self.lib.eth.ChainManager().CurrentBlock
- callerClosure := vm.NewClosure(&ethstate.Message{}, account, contract, script, gas, gasPrice)
- env := utils.NewEnv(state, block, account.Address(), value)
+ callerClosure := vm.NewClosure(&state.Message{}, account, contract, script, gas, gasPrice)
+ env := utils.NewEnv(statedb, block, account.Address(), value)
evm := vm.NewDebugVm(env)
evm.Dbg = self.Db
@@ -172,7 +172,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
}
}
- state.Reset()
+ statedb.Reset()
if !self.Db.interrupt {
self.Db.done = true
@@ -267,13 +267,13 @@ type storeVal struct {
Key, Value string
}
-func (self *Debugger) BreakHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *ethstate.StateObject) bool {
+func (self *Debugger) BreakHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool {
self.main.Logln("break on instr:", pc)
return self.halting(pc, op, mem, stack, stateObject)
}
-func (self *Debugger) StepHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *ethstate.StateObject) bool {
+func (self *Debugger) StepHook(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool {
return self.halting(pc, op, mem, stack, stateObject)
}
@@ -285,7 +285,7 @@ func (self *Debugger) BreakPoints() []int64 {
return self.breakPoints
}
-func (d *Debugger) halting(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *ethstate.StateObject) bool {
+func (d *Debugger) halting(pc int, op vm.OpCode, mem *vm.Memory, stack *vm.Stack, stateObject *state.StateObject) bool {
d.win.Root().Call("setInstruction", pc)
d.win.Root().Call("clearMem")
d.win.Root().Call("clearStack")
diff --git a/cmd/mist/ext_app.go b/cmd/mist/ext_app.go
index 4a3ab1d2c..d004f98c5 100644
--- a/cmd/mist/ext_app.go
+++ b/cmd/mist/ext_app.go
@@ -21,9 +21,9 @@ import (
"encoding/json"
"github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/javascript"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/ui/qt"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
@@ -38,7 +38,7 @@ type AppContainer interface {
NewBlock(*chain.Block)
NewWatcher(chan bool)
- Messages(ethstate.Messages, string)
+ Messages(state.Messages, string)
Post(string, int)
}
@@ -80,7 +80,7 @@ func (app *ExtApplication) run() {
// Subscribe to events
mux := app.lib.eth.EventMux()
- app.events = mux.Subscribe(chain.NewBlockEvent{}, ethstate.Messages(nil))
+ app.events = mux.Subscribe(chain.NewBlockEvent{}, state.Messages(nil))
// Call the main loop
go app.mainLoop()
@@ -109,7 +109,7 @@ func (app *ExtApplication) mainLoop() {
case chain.NewBlockEvent:
app.container.NewBlock(ev.Block)
- case ethstate.Messages:
+ case state.Messages:
for id, filter := range app.filters {
msgs := filter.FilterMessages(ev)
if len(msgs) > 0 {
diff --git a/cmd/mist/html_container.go b/cmd/mist/html_container.go
index 082d65f67..35e351b02 100644
--- a/cmd/mist/html_container.go
+++ b/cmd/mist/html_container.go
@@ -28,9 +28,9 @@ import (
"path/filepath"
"github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
"github.com/howeyc/fsnotify"
"gopkg.in/qml.v1"
@@ -143,7 +143,7 @@ func (app *HtmlApplication) NewBlock(block *chain.Block) {
app.webView.Call("onNewBlockCb", b)
}
-func (self *HtmlApplication) Messages(messages ethstate.Messages, id string) {
+func (self *HtmlApplication) Messages(messages state.Messages, id string) {
var msgs []javascript.JSMessage
for _, m := range messages {
msgs = append(msgs, javascript.NewJSMessage(m))
diff --git a/cmd/mist/qml_container.go b/cmd/mist/qml_container.go
index 4f6ca0b7f..60013ec2b 100644
--- a/cmd/mist/qml_container.go
+++ b/cmd/mist/qml_container.go
@@ -22,8 +22,8 @@ import (
"runtime"
"github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
)
@@ -70,7 +70,7 @@ func (app *QmlApplication) NewBlock(block *chain.Block) {
app.win.Call("onNewBlockCb", pblock)
}
-func (self *QmlApplication) Messages(msgs ethstate.Messages, id string) {
+func (self *QmlApplication) Messages(msgs state.Messages, id string) {
fmt.Println("IMPLEMENT QML APPLICATION MESSAGES METHOD")
}
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go
index 9d2554cf4..db299f18d 100644
--- a/cmd/mist/ui_lib.go
+++ b/cmd/mist/ui_lib.go
@@ -27,9 +27,9 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/chain"
"github.com/ethereum/go-ethereum/crypto"
- "github.com/ethereum/go-ethereum/ethstate"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/ui/qt"
"github.com/ethereum/go-ethereum/xeth"
"gopkg.in/qml.v1"
@@ -213,7 +213,7 @@ func (self *UiLib) StartDebugger() {
func (self *UiLib) NewFilter(object map[string]interface{}) (id int) {
filter := qt.NewFilterFromMap(object, self.eth)
- filter.MessageCallback = func(messages ethstate.Messages) {
+ filter.MessageCallback = func(messages state.Messages) {
self.win.Root().Call("invokeFilterCallback", xeth.ToJSMessages(messages), id)
}
id = self.eth.InstallFilter(filter)
diff --git a/cmd/utils/vm_env.go b/cmd/utils/vm_env.go
index 0a7b589ee..b06611cdd 100644
--- a/cmd/utils/vm_env.go
+++ b/cmd/utils/vm_env.go
@@ -4,19 +4,19 @@ import (
"math/big"
"github.com/ethereum/go-ethereum/chain"
- "github.com/ethereum/go-ethereum/ethstate"
+ "github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
type VMEnv struct {
- state *ethstate.State
+ state *state.State
block *chain.Block
transactor []byte
value *big.Int
}
-func NewEnv(state *ethstate.State, block *chain.Block, transactor []byte, value *big.Int) *VMEnv {
+func NewEnv(state *state.State, block *chain.Block, transactor []byte, value *big.Int) *VMEnv {
return &VMEnv{
state: state,
block: block,
@@ -25,17 +25,17 @@ func NewEnv(state *ethstate.State, block *chain.Block, transactor []byte, value
}
}
-func (self *VMEnv) Origin() []byte { return self.transactor }
-func (self *VMEnv) BlockNumber() *big.Int { return self.block.Number }
-func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash }
-func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase }
-func (self *VMEnv) Time() int64 { return self.block.Time }
-func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty }
-func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
-func (self *VMEnv) Value() *big.Int { return self.value }
-func (self *VMEnv) State() *ethstate.State { return self.state }
-func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
-func (self *VMEnv) AddLog(ethstate.Log) {}
+func (self *VMEnv) Origin() []byte { return self.transactor }
+func (self *VMEnv) BlockNumber() *big.Int { return self.block.Number }
+func (self *VMEnv) PrevHash() []byte { return self.block.PrevHash }
+func (self *VMEnv) Coinbase() []byte { return self.block.Coinbase }
+func (self *VMEnv) Time() int64 { return self.block.Time }
+func (self *VMEnv) Difficulty() *big.Int { return self.block.Difficulty }
+func (self *VMEnv) BlockHash() []byte { return self.block.Hash() }
+func (self *VMEnv) Value() *big.Int { return self.value }
+func (self *VMEnv) State() *state.State { return self.state }
+func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
+func (self *VMEnv) AddLog(state.Log) {}
func (self *VMEnv) Transfer(from, to vm.Account, amount *big.Int) error {
return vm.Transfer(from, to, amount)
}