55 "math/big"
66 "slices"
77
8- "github.com/ethereum/go-ethereum/common"
98 "github.com/ethereum/go-ethereum/core/vm"
109 "github.com/ethereum/go-ethereum/params"
1110
@@ -121,16 +120,6 @@ func (p Params) EIPs() []int {
121120 return eips
122121}
123122
124- // GetActiveStaticPrecompilesAddrs is a util function that the Active Precompiles
125- // as a slice of addresses.
126- func (p Params) GetActiveStaticPrecompilesAddrs() []common.Address {
127- precompiles := make([]common.Address, len(p.ActiveStaticPrecompiles))
128- for i, precompile := range p.ActiveStaticPrecompiles {
129- precompiles[i] = common.HexToAddress(precompile)
130- }
131- return precompiles
132- }
133-
134123// IsEVMChannel returns true if the channel provided is in the list of
135124// EVM channels
136125func (p Params) IsEVMChannel(channel string) bool {
@@ -151,12 +140,7 @@ func (act AccessControlType) Validate() error {
151140 return validateAllowlistAddresses(act.AccessControlList)
152141}
153142
154- func validateAccessType(i interface{}) error {
155- accessType, ok := i.(AccessType)
156- if !ok {
157- return fmt.Errorf("invalid access type type: %T", i)
158- }
159-
143+ func validateAccessType(accessType AccessType) error {
160144 switch accessType {
161145 case AccessTypePermissionless, AccessTypeRestricted, AccessTypePermissioned:
162146 return nil
@@ -165,12 +149,7 @@ func validateAccessType(i interface{}) error {
165149 }
166150}
167151
168- func validateAllowlistAddresses(i interface{}) error {
169- addresses, ok := i.([]string)
170- if !ok {
171- return fmt.Errorf("invalid whitelist addresses type: %T", i)
172- }
173-
152+ func validateAllowlistAddresses(addresses []string) error {
174153 for _, address := range addresses {
175154 if err := utils.ValidateAddress(address); err != nil {
176155 return fmt.Errorf("invalid whitelist address: %s", address)
@@ -179,12 +158,7 @@ func validateAllowlistAddresses(i interface{}) error {
179158 return nil
180159}
181160
182- func validateEIPs(i interface{}) error {
183- eips, ok := i.([]int64)
184- if !ok {
185- return fmt.Errorf("invalid EIP slice type: %T", i)
186- }
187-
161+ func validateEIPs(eips []int64) error {
188162 uniqueEIPs := make(map[int64]struct{})
189163
190164 for _, eip := range eips {
@@ -203,12 +177,7 @@ func validateEIPs(i interface{}) error {
203177}
204178
205179// ValidatePrecompiles checks if the precompile addresses are valid and unique.
206- func ValidatePrecompiles(i interface{}) error {
207- precompiles, ok := i.([]string)
208- if !ok {
209- return fmt.Errorf("invalid precompile slice type: %T", i)
210- }
211-
180+ func ValidatePrecompiles(precompiles []string) error {
212181 seenPrecompiles := make(map[string]struct{})
213182 for _, precompile := range precompiles {
214183 if _, ok := seenPrecompiles[precompile]; ok {
0 commit comments