aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-12-23 20:48:44 +0800
committerobscuren <geffobscura@gmail.com>2014-12-23 20:48:44 +0800
commit4cd79d8ddd7608d60344b13fe4bda7315429d1d9 (patch)
tree0d1abaa9ef5c302c1ef51e8e8dbd94e9e696f28a /cmd
parent4b52cd512d3c54451e680fcc6c3d67d059065bec (diff)
downloaddexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.gz
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.bz2
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.lz
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.xz
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.tar.zst
dexon-4cd79d8ddd7608d60344b13fe4bda7315429d1d9.zip
Refactored block & Transaction
* Includes new rlp decoder
Diffstat (limited to 'cmd')
-rw-r--r--cmd/ethereum/repl/repl.go6
-rw-r--r--cmd/utils/cmd.go2
-rw-r--r--cmd/utils/vm_env.go12
3 files changed, 7 insertions, 13 deletions
diff --git a/cmd/ethereum/repl/repl.go b/cmd/ethereum/repl/repl.go
index 4a7880ff4..822aaa19d 100644
--- a/cmd/ethereum/repl/repl.go
+++ b/cmd/ethereum/repl/repl.go
@@ -86,12 +86,6 @@ func (self *JSRepl) Stop() {
}
func (self *JSRepl) parseInput(code string) {
- defer func() {
- if r := recover(); r != nil {
- fmt.Println("[native] error", r)
- }
- }()
-
value, err := self.re.Run(code)
if err != nil {
fmt.Println(err)
diff --git a/cmd/utils/cmd.go b/cmd/utils/cmd.go
index 3e3ac617a..2b24ac532 100644
--- a/cmd/utils/cmd.go
+++ b/cmd/utils/cmd.go
@@ -325,7 +325,7 @@ func BlockDo(ethereum *eth.Ethereum, hash []byte) error {
return fmt.Errorf("unknown block %x", hash)
}
- parent := ethereum.ChainManager().GetBlock(block.PrevHash)
+ parent := ethereum.ChainManager().GetBlock(block.ParentHash())
_, err := ethereum.BlockManager().TransitionState(parent.State(), parent, block)
if err != nil {
diff --git a/cmd/utils/vm_env.go b/cmd/utils/vm_env.go
index 461a797c2..be6249e82 100644
--- a/cmd/utils/vm_env.go
+++ b/cmd/utils/vm_env.go
@@ -30,15 +30,15 @@ func NewEnv(state *state.StateDB, block *types.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) BlockNumber() *big.Int { return self.block.Number() }
+func (self *VMEnv) PrevHash() []byte { return self.block.ParentHash() }
+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) GasLimit() *big.Int { return self.block.GasLimit() }
func (self *VMEnv) Value() *big.Int { return self.value }
func (self *VMEnv) State() *state.StateDB { return self.state }
-func (self *VMEnv) GasLimit() *big.Int { return self.block.GasLimit }
func (self *VMEnv) Depth() int { return self.depth }
func (self *VMEnv) SetDepth(i int) { self.depth = i }
func (self *VMEnv) AddLog(log state.Log) {