mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 14:03:46 +00:00
accounts/abi/bind: rename field in MetaData
This commit is contained in:
parent
077556859c
commit
46e7e44e77
1 changed files with 7 additions and 6 deletions
|
|
@ -89,27 +89,28 @@ type WatchOpts struct {
|
||||||
|
|
||||||
// MetaData collects all metadata for a bound contract.
|
// MetaData collects all metadata for a bound contract.
|
||||||
type MetaData struct {
|
type MetaData struct {
|
||||||
mu sync.Mutex
|
|
||||||
Sigs map[string]string
|
Sigs map[string]string
|
||||||
Bin string
|
Bin string
|
||||||
ABI string
|
ABI string
|
||||||
ab *abi.ABI
|
|
||||||
Pattern string
|
Pattern string
|
||||||
Deps []*MetaData
|
Deps []*MetaData
|
||||||
|
|
||||||
|
mu sync.Mutex
|
||||||
|
parsedABI *abi.ABI
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *MetaData) GetAbi() (*abi.ABI, error) {
|
func (m *MetaData) GetAbi() (*abi.ABI, error) {
|
||||||
m.mu.Lock()
|
m.mu.Lock()
|
||||||
defer m.mu.Unlock()
|
defer m.mu.Unlock()
|
||||||
if m.ab != nil {
|
if m.parsedABI != nil {
|
||||||
return m.ab, nil
|
return m.parsedABI, nil
|
||||||
}
|
}
|
||||||
if parsed, err := abi.JSON(strings.NewReader(m.ABI)); err != nil {
|
if parsed, err := abi.JSON(strings.NewReader(m.ABI)); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
m.ab = &parsed
|
m.parsedABI = &parsed
|
||||||
}
|
}
|
||||||
return m.ab, nil
|
return m.parsedABI, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// BoundContract is the base wrapper object that reflects a contract on the
|
// BoundContract is the base wrapper object that reflects a contract on the
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue