diff options
author | Péter Szilágyi <peterke@gmail.com> | 2019-02-20 16:48:12 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 16:48:12 +0800 |
commit | c942700427557e3ff6de3aaf6b916e2f056c1ec2 (patch) | |
tree | cadf68e7206d6de42b1eefc6967214cf86e35ff2 /contracts/chequebook/api.go | |
parent | 7fa3509e2eaf1a4ebc12344590e5699406690f15 (diff) | |
parent | cde35439e058b4f9579830fec9fb65ae0b998346 (diff) | |
download | go-tangerine-1.8.23.tar go-tangerine-1.8.23.tar.gz go-tangerine-1.8.23.tar.bz2 go-tangerine-1.8.23.tar.lz go-tangerine-1.8.23.tar.xz go-tangerine-1.8.23.tar.zst go-tangerine-1.8.23.zip |
Merge pull request #19029 from holiman/update1.8v1.8.23
Update1.8
Diffstat (limited to 'contracts/chequebook/api.go')
-rw-r--r-- | contracts/chequebook/api.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/contracts/chequebook/api.go b/contracts/chequebook/api.go index b2b2365f3..fb7080308 100644 --- a/contracts/chequebook/api.go +++ b/contracts/chequebook/api.go @@ -27,40 +27,40 @@ const Version = "1.0" var errNoChequebook = errors.New("no chequebook") -type Api struct { +type API struct { chequebookf func() *Chequebook } -func NewApi(ch func() *Chequebook) *Api { - return &Api{ch} +func NewAPI(ch func() *Chequebook) *API { + return &API{ch} } -func (self *Api) Balance() (string, error) { - ch := self.chequebookf() +func (a *API) Balance() (string, error) { + ch := a.chequebookf() if ch == nil { return "", errNoChequebook } return ch.Balance().String(), nil } -func (self *Api) Issue(beneficiary common.Address, amount *big.Int) (cheque *Cheque, err error) { - ch := self.chequebookf() +func (a *API) Issue(beneficiary common.Address, amount *big.Int) (cheque *Cheque, err error) { + ch := a.chequebookf() if ch == nil { return nil, errNoChequebook } return ch.Issue(beneficiary, amount) } -func (self *Api) Cash(cheque *Cheque) (txhash string, err error) { - ch := self.chequebookf() +func (a *API) Cash(cheque *Cheque) (txhash string, err error) { + ch := a.chequebookf() if ch == nil { return "", errNoChequebook } return ch.Cash(cheque) } -func (self *Api) Deposit(amount *big.Int) (txhash string, err error) { - ch := self.chequebookf() +func (a *API) Deposit(amount *big.Int) (txhash string, err error) { + ch := a.chequebookf() if ch == nil { return "", errNoChequebook } |