Skip to content

Commit

Permalink
Merge pull request ethereum#16619 from kielbarry/contractsgolint
Browse files Browse the repository at this point in the history
contracts/*: golint updates for this or self warning
  • Loading branch information
karalabe authored Feb 7, 2019
2 parents 6f714ed + 159e991 commit 85b3b1c
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 237 deletions.
22 changes: 11 additions & 11 deletions contracts/chequebook/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Loading

0 comments on commit 85b3b1c

Please sign in to comment.