diff options
author | obscuren <geffobscura@gmail.com> | 2015-04-02 05:22:03 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-04-02 05:22:16 +0800 |
commit | 4391c3821567b1f5718b39ed660afb6cf65eeba3 (patch) | |
tree | 5d5ba9d1486d5fd7524e01717d1710aa4ec4708e /xeth | |
parent | 344b3556ebd8c96f96d78ad2d9d386e6ed66ce0a (diff) | |
download | dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.tar dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.tar.gz dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.tar.bz2 dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.tar.lz dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.tar.xz dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.tar.zst dexon-4391c3821567b1f5718b39ed660afb6cf65eeba3.zip |
Changed getters on account objects. Closes #610
* GetCode
* GetNonce
* GetStorage
* GetBalance
Diffstat (limited to 'xeth')
-rw-r--r-- | xeth/xeth.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go index 5936c0fb2..0a813ec99 100644 --- a/xeth/xeth.go +++ b/xeth/xeth.go @@ -308,21 +308,19 @@ func (self *XEth) NumberToHuman(balance string) string { } func (self *XEth) StorageAt(addr, storageAddr string) string { - storage := self.State().SafeGet(addr).StorageString(storageAddr) - - return common.ToHex(storage.Bytes()) + return common.ToHex(self.State().state.GetState(common.HexToAddress(addr), common.HexToHash(storageAddr))) } func (self *XEth) BalanceAt(addr string) string { - return self.State().SafeGet(addr).Balance().String() + return self.State().state.GetBalance(common.HexToAddress(addr)).String() } func (self *XEth) TxCountAt(address string) int { - return int(self.State().SafeGet(address).Nonce()) + return int(self.State().state.GetNonce(common.HexToAddress(address))) } func (self *XEth) CodeAt(address string) string { - return common.ToHex(self.State().SafeGet(address).Code()) + return common.ToHex(self.State().state.GetCode(common.HexToAddress(address))) } func (self *XEth) IsContract(address string) bool { |