Skip to content

Commit dbb2af6

Browse files
committed
Merge pull request bnb-chain#548 from tgerring/typescleanup
Fix Mist types build errors
2 parents 91a2275 + d186bf0 commit dbb2af6

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

‎cmd/mist/bindings.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (self *Gui) DumpState(hash, path string) {
6767
i, _ := strconv.Atoi(hash[1:])
6868
block = self.eth.ChainManager().GetBlockByNumber(uint64(i))
6969
} else {
70-
block = self.eth.ChainManager().GetBlock(common.Hex2Bytes(hash))
70+
block = self.eth.ChainManager().GetBlock(common.HexToHash(hash))
7171
}
7272

7373
if block == nil {

‎cmd/mist/gui.go‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ import (
3131
"sort"
3232
"time"
3333

34+
"github.com/ethereum/go-ethereum/common"
3435
"github.com/ethereum/go-ethereum/core"
3536
"github.com/ethereum/go-ethereum/core/types"
3637
"github.com/ethereum/go-ethereum/eth"
3738
"github.com/ethereum/go-ethereum/ethdb"
38-
"github.com/ethereum/go-ethereum/common"
3939
"github.com/ethereum/go-ethereum/logger"
4040
"github.com/ethereum/go-ethereum/ui/qt/qwhisper"
4141
"github.com/ethereum/go-ethereum/xeth"
@@ -230,16 +230,17 @@ func (self *Gui) loadMergedMiningOptions() {
230230

231231
func (gui *Gui) insertTransaction(window string, tx *types.Transaction) {
232232
var inout string
233-
if gui.eth.AccountManager().HasAccount(tx.From()) {
233+
from, _ := tx.From()
234+
if gui.eth.AccountManager().HasAccount(common.Hex2Bytes(from.Hex())) {
234235
inout = "send"
235236
} else {
236237
inout = "recv"
237238
}
238239

239240
var (
240241
ptx = xeth.NewTx(tx)
241-
send = common.Bytes2Hex(tx.From())
242-
rec = common.Bytes2Hex(tx.To())
242+
send = from.Hex()
243+
rec = tx.To().Hex()
243244
)
244245
ptx.Sender = send
245246
ptx.Address = rec
@@ -263,7 +264,7 @@ func (gui *Gui) readPreviousTransactions() {
263264
}
264265

265266
func (gui *Gui) processBlock(block *types.Block, initial bool) {
266-
name := common.Bytes2Hex(block.Coinbase())
267+
name := block.Coinbase().Hex()
267268
b := xeth.NewBlock(block)
268269
b.Name = name
269270

‎cmd/mist/html_container.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import (
2929
"path"
3030
"path/filepath"
3131

32-
"github.com/ethereum/go-ethereum/core/types"
3332
"github.com/ethereum/go-ethereum/common"
33+
"github.com/ethereum/go-ethereum/core/types"
3434
"github.com/ethereum/go-ethereum/xeth"
3535
"github.com/howeyc/fsnotify"
3636
"github.com/obscuren/qml"
@@ -139,7 +139,7 @@ func (app *HtmlApplication) Window() *qml.Window {
139139
}
140140

141141
func (app *HtmlApplication) NewBlock(block *types.Block) {
142-
b := &xeth.Block{Number: int(block.NumberU64()), Hash: common.Bytes2Hex(block.Hash())}
142+
b := &xeth.Block{Number: int(block.NumberU64()), Hash: block.Hash().Hex()}
143143
app.webView.Call("onNewBlockCb", b)
144144
}
145145

‎cmd/mist/qml_container.go‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
"runtime"
2626

2727
"github.com/ethereum/go-ethereum/core/types"
28-
"github.com/ethereum/go-ethereum/common"
2928
"github.com/ethereum/go-ethereum/xeth"
3029
"github.com/obscuren/qml"
3130
)
@@ -68,7 +67,7 @@ func (app *QmlApplication) NewWatcher(quitChan chan bool) {
6867

6968
// Events
7069
func (app *QmlApplication) NewBlock(block *types.Block) {
71-
pblock := &xeth.Block{Number: int(block.NumberU64()), Hash: common.Bytes2Hex(block.Hash())}
70+
pblock := &xeth.Block{Number: int(block.NumberU64()), Hash: block.Hash().Hex()}
7271
app.win.Call("onNewBlockCb", pblock)
7372
}
7473

0 commit comments

Comments
 (0)