aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2016-03-03 08:09:16 +0800
committerFelix Lange <fjl@twurst.com>2016-04-12 21:58:01 +0800
commit46e8940b19fee9bc21767a1341c382fd9c9d572a (patch)
tree384b700810910857cd40e099aba0d5a525eec066 /common
parent2dc20963e789c85bcc9170e15c0483e51ca42bfc (diff)
downloadgo-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.gz
go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.tar.zst
go-tangerine-46e8940b19fee9bc21767a1341c382fd9c9d572a.zip
accounts: streamline API
- Manager.Accounts no longer returns an error. - Manager methods take Account instead of common.Address. - All uses of Account with unkeyed fields are converted.
Diffstat (limited to 'common')
-rw-r--r--common/registrar/ethreg/api.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/registrar/ethreg/api.go b/common/registrar/ethreg/api.go
index d035616f2..4bffe69c5 100644
--- a/common/registrar/ethreg/api.go
+++ b/common/registrar/ethreg/api.go
@@ -158,8 +158,8 @@ func (be *registryAPIBackend) Call(fromStr, toStr, valueStr, gasStr, gasPriceStr
var from *state.StateObject
if len(fromStr) == 0 {
- accounts, err := be.am.Accounts()
- if err != nil || len(accounts) == 0 {
+ accounts := be.am.Accounts()
+ if len(accounts) == 0 {
from = statedb.GetOrNewStateObject(common.Address{})
} else {
from = statedb.GetOrNewStateObject(accounts[0].Address)
@@ -254,7 +254,7 @@ func (be *registryAPIBackend) Transact(fromStr, toStr, nonceStr, valueStr, gasSt
tx = types.NewTransaction(nonce, to, value, gas, price, data)
}
- acc := accounts.Account{from}
+ acc := accounts.Account{Address: from}
signature, err := be.am.Sign(acc, tx.SigHash().Bytes())
if err != nil {
return "", err