aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-18 23:58:22 +0800
committerobscuren <geffobscura@gmail.com>2014-11-18 23:58:22 +0800
commita1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b (patch)
treeaee891c8f02591e16377a6bf047c13f12d6d5123 /cmd
parent62cd9946ee16758a4e368cd0b5a0ba9fa4d94705 (diff)
downloadgo-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.gz
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.bz2
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.lz
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.xz
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.tar.zst
go-tangerine-a1b6a9ac29d0aa8d29a2c0535bafdb5fe4d4830b.zip
Begin of moving objects to types package
* Block(s) * Transaction(s)
Diffstat (limited to 'cmd')
-rw-r--r--cmd/mist/bindings.go5
-rw-r--r--cmd/mist/ext_app.go3
-rw-r--r--cmd/mist/gui.go7
-rw-r--r--cmd/mist/html_container.go5
-rw-r--r--cmd/mist/qml_container.go5
-rw-r--r--cmd/mist/ui_lib.go5
-rw-r--r--cmd/utils/vm_env.go7
7 files changed, 18 insertions, 19 deletions
diff --git a/cmd/mist/bindings.go b/cmd/mist/bindings.go
index 480c38b2e..eb78c3acc 100644
--- a/cmd/mist/bindings.go
+++ b/cmd/mist/bindings.go
@@ -21,8 +21,7 @@ import (
"encoding/json"
"os"
"strconv"
-
- "github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
@@ -106,7 +105,7 @@ func (self *Gui) DumpState(hash, path string) {
if len(hash) == 0 {
stateDump = self.eth.BlockManager().CurrentState().Dump()
} else {
- var block *chain.Block
+ var block *types.Block
if hash[0] == '#' {
i, _ := strconv.Atoi(hash[1:])
block = self.eth.ChainManager().GetBlockByNumber(uint64(i))
diff --git a/cmd/mist/ext_app.go b/cmd/mist/ext_app.go
index d004f98c5..22fa4bfaf 100644
--- a/cmd/mist/ext_app.go
+++ b/cmd/mist/ext_app.go
@@ -21,6 +21,7 @@ import (
"encoding/json"
"github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
@@ -36,7 +37,7 @@ type AppContainer interface {
Window() *qml.Window
Engine() *qml.Engine
- NewBlock(*chain.Block)
+ NewBlock(*types.Block)
NewWatcher(chan bool)
Messages(state.Messages, string)
Post(string, int)
diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go
index 62943fa9e..61b66cce3 100644
--- a/cmd/mist/gui.go
+++ b/cmd/mist/gui.go
@@ -32,6 +32,7 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/logger"
@@ -290,7 +291,7 @@ func (self *Gui) loadMergedMiningOptions() {
}
}
-func (gui *Gui) insertTransaction(window string, tx *chain.Transaction) {
+func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
pipe := xeth.New(gui.eth)
nameReg := pipe.World().Config().Get("NameReg")
addr := gui.address()
@@ -340,7 +341,7 @@ func (gui *Gui) insertTransaction(window string, tx *chain.Transaction) {
func (gui *Gui) readPreviousTransactions() {
it := gui.txDb.NewIterator()
for it.Next() {
- tx := chain.NewTransactionFromBytes(it.Value())
+ tx := types.NewTransactionFromBytes(it.Value())
gui.insertTransaction("post", tx)
@@ -348,7 +349,7 @@ func (gui *Gui) readPreviousTransactions() {
it.Release()
}
-func (gui *Gui) processBlock(block *chain.Block, initial bool) {
+func (gui *Gui) processBlock(block *types.Block, initial bool) {
name := strings.Trim(gui.pipe.World().Config().Get("NameReg").Storage(block.Coinbase).Str(), "\x00")
b := xeth.NewJSBlock(block)
b.Name = name
diff --git a/cmd/mist/html_container.go b/cmd/mist/html_container.go
index 35e351b02..4c6609a95 100644
--- a/cmd/mist/html_container.go
+++ b/cmd/mist/html_container.go
@@ -26,8 +26,7 @@ import (
"os"
"path"
"path/filepath"
-
- "github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
"github.com/ethereum/go-ethereum/state"
@@ -138,7 +137,7 @@ func (app *HtmlApplication) Window() *qml.Window {
return app.win
}
-func (app *HtmlApplication) NewBlock(block *chain.Block) {
+func (app *HtmlApplication) NewBlock(block *types.Block) {
b := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())}
app.webView.Call("onNewBlockCb", b)
}
diff --git a/cmd/mist/qml_container.go b/cmd/mist/qml_container.go
index 60013ec2b..b5986c16e 100644
--- a/cmd/mist/qml_container.go
+++ b/cmd/mist/qml_container.go
@@ -20,8 +20,7 @@ package main
import (
"fmt"
"runtime"
-
- "github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/xeth"
@@ -65,7 +64,7 @@ func (app *QmlApplication) NewWatcher(quitChan chan bool) {
}
// Events
-func (app *QmlApplication) NewBlock(block *chain.Block) {
+func (app *QmlApplication) NewBlock(block *types.Block) {
pblock := &xeth.JSBlock{Number: int(block.BlockInfo().Number), Hash: ethutil.Bytes2Hex(block.Hash())}
app.win.Call("onNewBlockCb", pblock)
}
diff --git a/cmd/mist/ui_lib.go b/cmd/mist/ui_lib.go
index 4e480144f..01352f192 100644
--- a/cmd/mist/ui_lib.go
+++ b/cmd/mist/ui_lib.go
@@ -26,6 +26,7 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethutil"
"github.com/ethereum/go-ethereum/javascript"
@@ -126,7 +127,7 @@ func (self *UiLib) PastPeers() *ethutil.List {
}
func (self *UiLib) ImportTx(rlpTx string) {
- tx := chain.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx))
+ tx := types.NewTransactionFromBytes(ethutil.Hex2Bytes(rlpTx))
self.eth.TxPool().QueueTransaction(tx)
}
@@ -228,7 +229,7 @@ func (self *UiLib) NewFilter(object map[string]interface{}) (id int) {
func (self *UiLib) NewFilterString(typ string) (id int) {
filter := chain.NewFilter(self.eth)
- filter.BlockCallback = func(block *chain.Block) {
+ filter.BlockCallback = func(block *types.Block) {
if self.win != nil && self.win.Root() != nil {
self.win.Root().Call("invokeFilterCallback", "{}", id)
} else {
diff --git a/cmd/utils/vm_env.go b/cmd/utils/vm_env.go
index e201627e2..b2788efa1 100644
--- a/cmd/utils/vm_env.go
+++ b/cmd/utils/vm_env.go
@@ -2,21 +2,20 @@ package utils
import (
"math/big"
-
- "github.com/ethereum/go-ethereum/chain"
+ "github.com/ethereum/go-ethereum/chain/types"
"github.com/ethereum/go-ethereum/state"
"github.com/ethereum/go-ethereum/vm"
)
type VMEnv struct {
state *state.State
- block *chain.Block
+ block *types.Block
transactor []byte
value *big.Int
}
-func NewEnv(state *state.State, block *chain.Block, transactor []byte, value *big.Int) *VMEnv {
+func NewEnv(state *state.State, block *types.Block, transactor []byte, value *big.Int) *VMEnv {
return &VMEnv{
state: state,
block: block,