aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/state.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-03-14 18:46:32 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-03-14 18:46:32 +0800
commit51df765e3892285bda6d40340dc6febfcd2e7ce6 (patch)
treeeb55d41ec2f62babef19af22e7fadf5280935d47 /xeth/state.go
parentb927c29469864424a97c06ff2f31e2d882b01cd7 (diff)
parent9754e7aca79a3d24ac17589f548072a4dca68fbb (diff)
downloaddexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.tar
dexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.tar.gz
dexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.tar.bz2
dexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.tar.lz
dexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.tar.xz
dexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.tar.zst
dexon-51df765e3892285bda6d40340dc6febfcd2e7ce6.zip
Merge pull request #481 from maran/feature/fromHexDry
DRY-up the use of fromHex in the project
Diffstat (limited to 'xeth/state.go')
-rw-r--r--xeth/state.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/xeth/state.go b/xeth/state.go
index 0f6a042b3..bb729db33 100644
--- a/xeth/state.go
+++ b/xeth/state.go
@@ -1,6 +1,9 @@
package xeth
-import "github.com/ethereum/go-ethereum/state"
+import (
+ "github.com/ethereum/go-ethereum/ethutil"
+ "github.com/ethereum/go-ethereum/state"
+)
type State struct {
xeth *XEth
@@ -16,7 +19,7 @@ func (self *State) State() *state.StateDB {
}
func (self *State) Get(addr string) *Object {
- return &Object{self.state.GetStateObject(fromHex(addr))}
+ return &Object{self.state.GetStateObject(ethutil.FromHex(addr))}
}
func (self *State) SafeGet(addr string) *Object {
@@ -24,9 +27,9 @@ func (self *State) SafeGet(addr string) *Object {
}
func (self *State) safeGet(addr string) *state.StateObject {
- object := self.state.GetStateObject(fromHex(addr))
+ object := self.state.GetStateObject(ethutil.FromHex(addr))
if object == nil {
- object = state.NewStateObject(fromHex(addr), self.xeth.eth.StateDb())
+ object = state.NewStateObject(ethutil.FromHex(addr), self.xeth.eth.StateDb())
}
return object