@@ -27,40 +27,40 @@ const Version = "1.0"
27
27
28
28
var errNoChequebook = errors .New ("no chequebook" )
29
29
30
- type Api struct {
30
+ type API struct {
31
31
chequebookf func () * Chequebook
32
32
}
33
33
34
- func NewApi (ch func () * Chequebook ) * Api {
35
- return & Api {ch }
34
+ func NewAPI (ch func () * Chequebook ) * API {
35
+ return & API {ch }
36
36
}
37
37
38
- func (self * Api ) Balance () (string , error ) {
39
- ch := self .chequebookf ()
38
+ func (a * API ) Balance () (string , error ) {
39
+ ch := a .chequebookf ()
40
40
if ch == nil {
41
41
return "" , errNoChequebook
42
42
}
43
43
return ch .Balance ().String (), nil
44
44
}
45
45
46
- func (self * Api ) Issue (beneficiary common.Address , amount * big.Int ) (cheque * Cheque , err error ) {
47
- ch := self .chequebookf ()
46
+ func (a * API ) Issue (beneficiary common.Address , amount * big.Int ) (cheque * Cheque , err error ) {
47
+ ch := a .chequebookf ()
48
48
if ch == nil {
49
49
return nil , errNoChequebook
50
50
}
51
51
return ch .Issue (beneficiary , amount )
52
52
}
53
53
54
- func (self * Api ) Cash (cheque * Cheque ) (txhash string , err error ) {
55
- ch := self .chequebookf ()
54
+ func (a * API ) Cash (cheque * Cheque ) (txhash string , err error ) {
55
+ ch := a .chequebookf ()
56
56
if ch == nil {
57
57
return "" , errNoChequebook
58
58
}
59
59
return ch .Cash (cheque )
60
60
}
61
61
62
- func (self * Api ) Deposit (amount * big.Int ) (txhash string , err error ) {
63
- ch := self .chequebookf ()
62
+ func (a * API ) Deposit (amount * big.Int ) (txhash string , err error ) {
63
+ ch := a .chequebookf ()
64
64
if ch == nil {
65
65
return "" , errNoChequebook
66
66
}
0 commit comments