Begin of moving objects to types package
* Block(s) * Transaction(s)
This commit is contained in:
@ -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))
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user