aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-19 01:23:37 +0800
committerobscuren <geffobscura@gmail.com>2015-03-19 01:23:37 +0800
commitf9a6038f5b82cad6956c9cbb7f1220d97570632b (patch)
tree78fb61bed1924b60c3c4d59e5a5a471f55f91de7 /xeth/xeth.go
parent4d0ae8b0cb32e9de63092bc36022ea4af76cad8b (diff)
parentbaca0c2251a2587c136999a91449d9b6f7a6c60f (diff)
downloadgo-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.gz
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.tar.zst
go-tangerine-f9a6038f5b82cad6956c9cbb7f1220d97570632b.zip
merge
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 672b83332..686ed4432 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -170,7 +170,7 @@ func (self *XEth) Accounts() []string {
accounts, _ := self.eth.AccountManager().Accounts()
accountAddresses := make([]string, len(accounts))
for i, ac := range accounts {
- accountAddresses[i] = toHex(ac.Address)
+ accountAddresses[i] = common.ToHex(ac.Address)
}
return accountAddresses
}
@@ -201,7 +201,7 @@ func (self *XEth) IsListening() bool {
func (self *XEth) Coinbase() string {
cb, _ := self.eth.AccountManager().Coinbase()
- return toHex(cb)
+ return common.ToHex(cb)
}
func (self *XEth) NumberToHuman(balance string) string {
@@ -213,7 +213,7 @@ func (self *XEth) NumberToHuman(balance string) string {
func (self *XEth) StorageAt(addr, storageAddr string) string {
storage := self.State().SafeGet(addr).StorageString(storageAddr)
- return toHex(storage.Bytes())
+ return common.ToHex(storage.Bytes())
}
func (self *XEth) BalanceAt(addr string) string {
@@ -225,7 +225,7 @@ func (self *XEth) TxCountAt(address string) int {
}
func (self *XEth) CodeAt(address string) string {
- return toHex(self.State().SafeGet(address).Code())
+ return common.ToHex(self.State().SafeGet(address).Code())
}
func (self *XEth) IsContract(address string) bool {
@@ -238,7 +238,7 @@ func (self *XEth) SecretToAddress(key string) string {
return ""
}
- return toHex(pair.Address())
+ return common.ToHex(pair.Address())
}
type KeyVal struct {
@@ -251,7 +251,7 @@ func (self *XEth) EachStorage(addr string) string {
object := self.State().SafeGet(addr)
it := object.Trie().Iterator()
for it.Next() {
- values = append(values, KeyVal{toHex(it.Key), toHex(it.Value)})
+ values = append(values, KeyVal{common.ToHex(it.Key), common.ToHex(it.Value)})
}
valuesJson, err := json.Marshal(values)
@@ -265,7 +265,7 @@ func (self *XEth) EachStorage(addr string) string {
func (self *XEth) ToAscii(str string) string {
padded := common.RightPadBytes([]byte(str), 32)
- return "0x" + toHex(padded)
+ return "0x" + common.ToHex(padded)
}
func (self *XEth) FromAscii(str string) string {
@@ -325,7 +325,7 @@ func (self *XEth) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr, dataStr st
vmenv := core.NewEnv(statedb, self.chainManager, msg, block)
res, err := vmenv.Call(msg.from, msg.to, msg.data, msg.gas, msg.gasPrice, msg.value)
- return toHex(res), err
+ return common.ToHex(res), err
}
func (self *XEth) Transact(fromStr, toStr, valueStr, gasStr, gasPriceStr, codeStr string) (string, error) {