Skip to content

Commit

Permalink
CR's fixes: rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeniy-scherbina committed May 3, 2024
1 parent 013442b commit c2e188f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion x/evm/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func InitGenesis(
) []abci.ValidatorUpdate {
k.WithChainID(ctx)

err := types.CheckIfEnabledPrecompilesAreRegistered(
err := types.ValidatePrecompileRegistration(
registeredModules,
data.Params.GetEnabledPrecompiles(),
)
Expand Down
3 changes: 2 additions & 1 deletion x/evm/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ func IsLondon(ethConfig *params.ChainConfig, height int64) bool {
return ethConfig.IsLondon(big.NewInt(height))
}

func CheckIfEnabledPrecompilesAreRegistered(registeredModules []precompile_modules.Module, enabledPrecompiles []string) error {
// ValidatePrecompileRegistration checks that all enabled precompiles are registered.
func ValidatePrecompileRegistration(registeredModules []precompile_modules.Module, enabledPrecompiles []string) error {
registeredAddrs := make(map[string]struct{}, len(registeredModules))

for _, module := range registeredModules {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/types/params_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestIsLondon(t *testing.T) {
}
}

func TestCheckIfEnabledPrecompilesAreRegistered(t *testing.T) {
func TestValidatePrecompileRegistration(t *testing.T) {
m := func(addr string) precompile_modules.Module {
return precompile_modules.Module{
Address: common.HexToAddress(addr),
Expand Down Expand Up @@ -388,7 +388,7 @@ func TestCheckIfEnabledPrecompilesAreRegistered(t *testing.T) {

for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
err := CheckIfEnabledPrecompilesAreRegistered(tc.registeredModules, tc.enabledPrecompiles)
err := ValidatePrecompileRegistration(tc.registeredModules, tc.enabledPrecompiles)

if tc.errorMsg != "" {
require.Error(t, err, tc.name)
Expand Down

0 comments on commit c2e188f

Please sign in to comment.