Skip to content

Commit 46e7e44

Browse files
committed
accounts/abi/bind: rename field in MetaData
1 parent 0775568 commit 46e7e44

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

accounts/abi/bind/base.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,27 +89,28 @@ type WatchOpts struct {
8989

9090
// MetaData collects all metadata for a bound contract.
9191
type MetaData struct {
92-
mu sync.Mutex
9392
Sigs map[string]string
9493
Bin string
9594
ABI string
96-
ab *abi.ABI
9795
Pattern string
9896
Deps []*MetaData
97+
98+
mu sync.Mutex
99+
parsedABI *abi.ABI
99100
}
100101

101102
func (m *MetaData) GetAbi() (*abi.ABI, error) {
102103
m.mu.Lock()
103104
defer m.mu.Unlock()
104-
if m.ab != nil {
105-
return m.ab, nil
105+
if m.parsedABI != nil {
106+
return m.parsedABI, nil
106107
}
107108
if parsed, err := abi.JSON(strings.NewReader(m.ABI)); err != nil {
108109
return nil, err
109110
} else {
110-
m.ab = &parsed
111+
m.parsedABI = &parsed
111112
}
112-
return m.ab, nil
113+
return m.parsedABI, nil
113114
}
114115

115116
// BoundContract is the base wrapper object that reflects a contract on the

0 commit comments

Comments
 (0)