Skip to content

Conversation

@JonathanOppenheimer
Copy link
Member

@JonathanOppenheimer JonathanOppenheimer commented Nov 24, 2025

Syncs ava-labs/coreth#1303

  • Requesting @alarso16 as he was the original author
  • Requesting @ceyonur as he was the merging approver

@JonathanOppenheimer JonathanOppenheimer marked this pull request as ready for review November 25, 2025 06:55
@JonathanOppenheimer JonathanOppenheimer requested a review from a team as a code owner November 25, 2025 06:55
// "your custom test name": {
// Config: NewConfig(utils.NewUint64(3), {{- if .Contract.AllowList}} admins, enableds, managers{{- end}}),
// ExpectedError: ErrYourCustomError.Error(),
// WantError: ErrYourCustomError,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this break dependent users?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user was using this template generation code and then doing a strings.Contains, then yeah I guess it would -- do we really care about that though? Is this supposed to be externally supported code? The fix is incredibly easy too -- just use errors.Is (as you're supposed to)


var ErrCannotAddManagersBeforeDurango = errors.New("cannot add managers before Durango")
var (
ErrAdminAndEnabledAddress = errors.New("cannot set address as both admin and enabled")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these all need exported?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they do -- I just tried for all of them. They're declared in package allowlist and used in package allowlist_test

unpacked, err2 := UnpackSetFeeConfigInput(input, true)
if err != nil {
require.ErrorContains(t, err2, err.Error())
require.Equal(t, err.Error(), err2.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use ErrorIs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error chain are different, so ErrorIs fails.

Error:      	Target error should be in err chain:
            	expected: "invalid input length for fee config Input: 260"
            	in chain: "invalid input length for fee config Input: 260"
            		"invalid input length for fee config Input"

I didn't want to touch the old unpack config -- seems like it shouldn't be modified


var (
_ Backend = (*backend)(nil)
ErrValidateBlock = errors.New("failed to validate block message")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do these have to be exported?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The errors are declared in package warp and used in package evm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants