forked from cerc-io/plugeth
Updated to reflect BlockChain changes
This commit is contained in:
parent
82a2e4fe28
commit
6ea44c466a
@ -60,11 +60,11 @@ func main() {
|
|||||||
var block *ethchain.Block
|
var block *ethchain.Block
|
||||||
|
|
||||||
if len(DumpHash) == 0 && DumpNumber == -1 {
|
if len(DumpHash) == 0 && DumpNumber == -1 {
|
||||||
block = ethereum.BlockChain().CurrentBlock
|
block = ethereum.ChainManager().CurrentBlock
|
||||||
} else if len(DumpHash) > 0 {
|
} else if len(DumpHash) > 0 {
|
||||||
block = ethereum.BlockChain().GetBlock(ethutil.Hex2Bytes(DumpHash))
|
block = ethereum.ChainManager().GetBlock(ethutil.Hex2Bytes(DumpHash))
|
||||||
} else {
|
} else {
|
||||||
block = ethereum.BlockChain().GetBlockByNumber(uint64(DumpNumber))
|
block = ethereum.ChainManager().GetBlockByNumber(uint64(DumpNumber))
|
||||||
}
|
}
|
||||||
|
|
||||||
if block == nil {
|
if block == nil {
|
||||||
|
@ -139,10 +139,10 @@ func (self *JSRE) dump(call otto.FunctionCall) otto.Value {
|
|||||||
var block *ethchain.Block
|
var block *ethchain.Block
|
||||||
if call.Argument(0).IsNumber() {
|
if call.Argument(0).IsNumber() {
|
||||||
num, _ := call.Argument(0).ToInteger()
|
num, _ := call.Argument(0).ToInteger()
|
||||||
block = self.ethereum.BlockChain().GetBlockByNumber(uint64(num))
|
block = self.ethereum.ChainManager().GetBlockByNumber(uint64(num))
|
||||||
} else if call.Argument(0).IsString() {
|
} else if call.Argument(0).IsString() {
|
||||||
hash, _ := call.Argument(0).ToString()
|
hash, _ := call.Argument(0).ToString()
|
||||||
block = self.ethereum.BlockChain().GetBlock(ethutil.Hex2Bytes(hash))
|
block = self.ethereum.ChainManager().GetBlock(ethutil.Hex2Bytes(hash))
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("invalid argument for dump. Either hex string or number")
|
fmt.Println("invalid argument for dump. Either hex string or number")
|
||||||
}
|
}
|
||||||
|
@ -96,9 +96,9 @@ func (self *Gui) DumpState(hash, path string) {
|
|||||||
var block *ethchain.Block
|
var block *ethchain.Block
|
||||||
if hash[0] == '#' {
|
if hash[0] == '#' {
|
||||||
i, _ := strconv.Atoi(hash[1:])
|
i, _ := strconv.Atoi(hash[1:])
|
||||||
block = self.eth.BlockChain().GetBlockByNumber(uint64(i))
|
block = self.eth.ChainManager().GetBlockByNumber(uint64(i))
|
||||||
} else {
|
} else {
|
||||||
block = self.eth.BlockChain().GetBlock(ethutil.Hex2Bytes(hash))
|
block = self.eth.ChainManager().GetBlock(ethutil.Hex2Bytes(hash))
|
||||||
}
|
}
|
||||||
|
|
||||||
if block == nil {
|
if block == nil {
|
||||||
|
@ -131,7 +131,7 @@ func (self *DebuggerWindow) Debug(valueStr, gasStr, gasPriceStr, scriptStr, data
|
|||||||
|
|
||||||
self.SetAsm(script)
|
self.SetAsm(script)
|
||||||
|
|
||||||
block := self.lib.eth.BlockChain().CurrentBlock
|
block := self.lib.eth.ChainManager().CurrentBlock
|
||||||
|
|
||||||
callerClosure := vm.NewClosure(ðstate.Message{}, account, contract, script, gas, gasPrice)
|
callerClosure := vm.NewClosure(ðstate.Message{}, account, contract, script, gas, gasPrice)
|
||||||
env := utils.NewEnv(state, block, account.Address(), value)
|
env := utils.NewEnv(state, block, account.Address(), value)
|
||||||
|
12
mist/gui.go
12
mist/gui.go
@ -228,10 +228,10 @@ func (gui *Gui) CreateAndSetPrivKey() (string, string, string, string) {
|
|||||||
return gui.eth.KeyManager().KeyPair().AsStrings()
|
return gui.eth.KeyManager().KeyPair().AsStrings()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) setInitialBlockChain() {
|
func (gui *Gui) setInitialChainManager() {
|
||||||
sBlk := gui.eth.BlockChain().LastBlockHash
|
sBlk := gui.eth.ChainManager().LastBlockHash
|
||||||
blk := gui.eth.BlockChain().GetBlock(sBlk)
|
blk := gui.eth.ChainManager().GetBlock(sBlk)
|
||||||
for ; blk != nil; blk = gui.eth.BlockChain().GetBlock(sBlk) {
|
for ; blk != nil; blk = gui.eth.ChainManager().GetBlock(sBlk) {
|
||||||
sBlk = blk.PrevHash
|
sBlk = blk.PrevHash
|
||||||
addr := gui.address()
|
addr := gui.address()
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ func (gui *Gui) update() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
go gui.setInitialBlockChain()
|
go gui.setInitialChainManager()
|
||||||
gui.loadAddressBook()
|
gui.loadAddressBook()
|
||||||
gui.setPeerInfo()
|
gui.setPeerInfo()
|
||||||
gui.readPreviousTransactions()
|
gui.readPreviousTransactions()
|
||||||
@ -464,7 +464,7 @@ func (gui *Gui) update() {
|
|||||||
case <-peerUpdateTicker.C:
|
case <-peerUpdateTicker.C:
|
||||||
gui.setPeerInfo()
|
gui.setPeerInfo()
|
||||||
case <-generalUpdateTicker.C:
|
case <-generalUpdateTicker.C:
|
||||||
statusText := "#" + gui.eth.BlockChain().CurrentBlock.Number.String()
|
statusText := "#" + gui.eth.ChainManager().CurrentBlock.Number.String()
|
||||||
lastBlockLabel.Set("text", statusText)
|
lastBlockLabel.Set("text", statusText)
|
||||||
|
|
||||||
if gui.miner != nil {
|
if gui.miner != nil {
|
||||||
|
@ -169,7 +169,7 @@ func StartEthereum(ethereum *eth.Ethereum, UseSeed bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func ShowGenesis(ethereum *eth.Ethereum) {
|
func ShowGenesis(ethereum *eth.Ethereum) {
|
||||||
logger.Infoln(ethereum.BlockChain().Genesis())
|
logger.Infoln(ethereum.ChainManager().Genesis())
|
||||||
exit(nil)
|
exit(nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,12 +310,12 @@ func StopMining(ethereum *eth.Ethereum) bool {
|
|||||||
|
|
||||||
// Replay block
|
// Replay block
|
||||||
func BlockDo(ethereum *eth.Ethereum, hash []byte) error {
|
func BlockDo(ethereum *eth.Ethereum, hash []byte) error {
|
||||||
block := ethereum.BlockChain().GetBlock(hash)
|
block := ethereum.ChainManager().GetBlock(hash)
|
||||||
if block == nil {
|
if block == nil {
|
||||||
return fmt.Errorf("unknown block %x", hash)
|
return fmt.Errorf("unknown block %x", hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
parent := ethereum.BlockChain().GetBlock(block.PrevHash)
|
parent := ethereum.ChainManager().GetBlock(block.PrevHash)
|
||||||
|
|
||||||
_, err := ethereum.StateManager().ApplyDiff(parent.State(), parent, block)
|
_, err := ethereum.StateManager().ApplyDiff(parent.State(), parent, block)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user