accounts/abi/bind: remove unused fields from template structs

This commit is contained in:
Jared Wasinger 2024-12-19 19:42:37 +07:00 committed by Felix Lange
parent 6afe90dddd
commit 5eb7271f0b
2 changed files with 27 additions and 30 deletions

View file

@ -238,7 +238,6 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string]
Receive: receive, Receive: receive,
Events: events, Events: events,
Libraries: make(map[string]string), Libraries: make(map[string]string),
AllLibraries: make(map[string]string),
} }
// Function 4-byte signatures are stored in the same sequence // Function 4-byte signatures are stored in the same sequence

View file

@ -27,7 +27,6 @@ type tmplData struct {
Package string // Name of the package to place the generated file in Package string // Name of the package to place the generated file in
Contracts map[string]*tmplContract // List of contracts to generate into this file Contracts map[string]*tmplContract // List of contracts to generate into this file
Libraries map[string]string // Map the bytecode's link pattern to the library name Libraries map[string]string // Map the bytecode's link pattern to the library name
InvertedLibs map[string]string // map of the contract's name to the link pattern
Structs map[string]*tmplStruct // Contract struct type definitions Structs map[string]*tmplStruct // Contract struct type definitions
} }
@ -44,7 +43,6 @@ type tmplContract struct {
Receive *tmplMethod // Additional special receive function Receive *tmplMethod // Additional special receive function
Events map[string]*tmplEvent // Contract events accessors Events map[string]*tmplEvent // Contract events accessors
Libraries map[string]string // Same as tmplData, but filtered to only keep direct deps that the contract needs Libraries map[string]string // Same as tmplData, but filtered to only keep direct deps that the contract needs
AllLibraries map[string]string // same as Libraries, but all direct/indirect library dependencies
Library bool // Indicator whether the contract is a library Library bool // Indicator whether the contract is a library
} }
@ -55,7 +53,7 @@ type tmplContractV2 struct {
Constructor abi.Method // Contract constructor for deploy parametrization Constructor abi.Method // Contract constructor for deploy parametrization
Calls map[string]*tmplMethod // All contract methods (excluding fallback, receive) Calls map[string]*tmplMethod // All contract methods (excluding fallback, receive)
Events map[string]*tmplEvent // Contract events accessors Events map[string]*tmplEvent // Contract events accessors
Libraries map[string]string // all direct/indirect library dependencies Libraries map[string]string // all direct library dependencies
Errors map[string]*tmplError // all errors defined Errors map[string]*tmplError // all errors defined
} }