Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d9f4445
style: Use require.ErrorIs whenever possible (#1303)
alarso16 Oct 16, 2025
ec2e94a
style: Use require.ErrorIs whenever possible (#1303)
alarso16 Oct 16, 2025
34b4793
test: forbidgo linter
JonathanOppenheimer Nov 25, 2025
fbc5bb6
test: define nativeminter sentinel errors
JonathanOppenheimer Nov 25, 2025
2e3a48b
test: use sentinel errors
JonathanOppenheimer Nov 25, 2025
3604a8e
test: update precompile templates
JonathanOppenheimer Nov 25, 2025
f770a6f
Merge remote-tracking branch 'origin' into JonathanOppenheimer/sync-p…
JonathanOppenheimer Dec 1, 2025
dc29219
Merge branch 'master' into JonathanOppenheimer/sync-pr-1303-remaining…
JonathanOppenheimer Dec 1, 2025
5ca350c
test: Austin suggestions
JonathanOppenheimer Dec 1, 2025
609c644
test: properly wrap errors
JonathanOppenheimer Dec 1, 2025
4bfecaf
test: only equal on nil
JonathanOppenheimer Dec 1, 2025
6db916a
Merge branch 'master' into JonathanOppenheimer/sync-pr-1303-remaining…
JonathanOppenheimer Dec 1, 2025
b68b19d
docs: revert comment shortening
JonathanOppenheimer Dec 2, 2025
ed6b12e
style: declare error seperately
JonathanOppenheimer Dec 3, 2025
73c5826
style: consistently use want
JonathanOppenheimer Dec 3, 2025
3402130
Merge branch 'master' into JonathanOppenheimer/sync-pr-1303-remaining…
JonathanOppenheimer Dec 3, 2025
49d7da7
fix: revert change
JonathanOppenheimer Dec 3, 2025
bb3f2fa
style: revert expected -> want
JonathanOppenheimer Dec 3, 2025
811a105
style: revert expected -> want
JonathanOppenheimer Dec 3, 2025
95b83cf
style: revert expected -> want
JonathanOppenheimer Dec 3, 2025
8f5aca5
Merge branch 'master' into JonathanOppenheimer/sync-pr-1303-remaining…
JonathanOppenheimer Dec 3, 2025
bfd7442
Merge branch 'master' into JonathanOppenheimer/sync-pr-1303-remaining…
JonathanOppenheimer Dec 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .avalanche-golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ linters:
forbidigo:
# Forbid the following identifiers (list of regexp).
forbid:
# - pattern: require\.Error$(# ErrorIs should be used instead)?
# - pattern: require\.ErrorContains$(# ErrorIs should be used instead)?
# - pattern: require\.EqualValues$(# Equal should be used instead)?
# - pattern: require\.NotEqualValues$(# NotEqual should be used instead)?
- pattern: require\.Error$(# ErrorIs should be used instead)?
- pattern: require\.ErrorContains$(# ErrorIs should be used instead)?
- pattern: require\.EqualValues$(# Equal should be used instead)?
- pattern: require\.NotEqualValues$(# NotEqual should be used instead)?
- pattern: ^(t|b|tb|f)\.(Fatal|Fatalf|Error|Errorf)$(# the require library should be used instead)?
# - pattern: ^sort\.(Slice|Strings)$(# the slices package should be used instead)?
- pattern: ^sort\.(Slice|Strings)$(# the slices package should be used instead)?
# Exclude godoc examples from forbidigo checks.
exclude-godoc-examples: false
gosec:
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/abi_extra_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestUnpackInputIntoInterface(t *testing.T) {
err = abi.UnpackInputIntoInterface(&v, "receive", data, test.strictMode) // skips 4 byte selector

if test.expectedErrorSubstring != "" {
require.ErrorContains(t, err, test.expectedErrorSubstring)
require.ErrorContains(t, err, test.expectedErrorSubstring) //nolint:forbidigo // uses upstream code
} else {
require.NoError(t, err)
require.Equal(t, input, v)
Expand Down
2 changes: 1 addition & 1 deletion accounts/abi/bind/precompilebind/precompile_bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ func TestPrecompileBind(t *testing.T) {
// Generate the binding and create a Go source file in the workspace
bindedFiles, err := PrecompileBind(types, tt.abi, []string{""}, nil, tt.name, bind.LangGo, nil, nil, "contract.abi", true)
if tt.errMsg != "" {
require.ErrorContains(t, err, tt.errMsg)
require.ErrorContains(t, err, tt.errMsg) //nolint:forbidigo // uses upstream code
return
}
require.NoError(t, err, "test %d: failed to generate binding: %v", i, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ func TestVerify(t *testing.T) {
config.EXPECT().IsDurango(gomock.Any()).Return(true).AnyTimes()
return config
}(),
ExpectedError: "",
WantError: nil,
},
// CUSTOM CODE STARTS HERE
// Add your own Verify tests here, e.g.:
// "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)

// },
}
{{- if .Contract.AllowList}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ var(
{{- end}}
SuppliedGas: {{$func.Normalized.Name}}GasCost,
ReadOnly: false,
ExpectedErr: {{if $fail}} ErrCannot{{$func.Normalized.Name}}.Error() {{- else}} "" {{- end}},
ExpectedErr: {{if $fail}} ErrCannot{{$func.Normalized.Name}} {{- else}} nil {{- end}},
},
{{- end}}
{{- end}}
Expand Down Expand Up @@ -124,7 +124,7 @@ var(
},
SuppliedGas: {{$func.Normalized.Name}}GasCost,
ReadOnly: true,
ExpectedErr: vm.ErrWriteProtection.Error(),
ExpectedErr: vm.ErrWriteProtection,
},
{{- end}}
{
Expand All @@ -151,7 +151,7 @@ var(
},
SuppliedGas: {{$func.Normalized.Name}}GasCost - 1,
ReadOnly: false,
ExpectedErr: vm.ErrOutOfGas.Error(),
ExpectedErr: vm.ErrOutOfGas,
},
{{- end}}
{{- if .Contract.Fallback}}
Expand All @@ -161,23 +161,23 @@ var(
Input: []byte{},
SuppliedGas: {{.Contract.Type}}FallbackGasCost - 1,
ReadOnly: false,
ExpectedErr: vm.ErrOutOfGas.Error(),
ExpectedErr: vm.ErrOutOfGas,
},
{
Name: "readOnly fallback should fail",
Caller: common.Address{1},
Input: []byte{},
SuppliedGas: {{.Contract.Type}}FallbackGasCost,
ReadOnly: true,
ExpectedErr: vm.ErrWriteProtection.Error(),
ExpectedErr: vm.ErrWriteProtection,
},
{
Name: "fallback should succeed",
Caller: common.Address{1},
Input: []byte{},
SuppliedGas: {{.Contract.Type}}FallbackGasCost,
ReadOnly: false,
ExpectedErr: "",
ExpectedErr: nil,
// CUSTOM CODE STARTS HERE
// set expected output here
ExpectedRes: []byte{},
Expand Down
76 changes: 52 additions & 24 deletions commontype/fee_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,34 @@ import (
"github.com/ava-labs/subnet-evm/utils"
)

var (
ErrGasLimitTooLow = errors.New("gasLimit cannot be less than or equal to 0")
ErrGasLimitNil = errors.New("gasLimit cannot be nil")
ErrMinBlockGasCostTooHigh = errors.New("minBlockGasCost cannot be greater than maxBlockGasCost")

errMinBaseFeeNil = errors.New("minBaseFee cannot be nil")
errTargetGasNil = errors.New("targetGas cannot be nil")
errBaseFeeChangeDenominatorNil = errors.New("baseFeeChangeDenominator cannot be nil")
errMinBlockGasCostNil = errors.New("minBlockGasCost cannot be nil")
errMaxBlockGasCostNil = errors.New("maxBlockGasCost cannot be nil")
errBlockGasCostStepNil = errors.New("blockGasCostStep cannot be nil")
errTargetBlockRateTooLow = errors.New("targetBlockRate cannot be less than or equal to 0")
errMinBaseFeeNegative = errors.New("minBaseFee cannot be less than 0")
errTargetGasTooLow = errors.New("targetGas cannot be less than or equal to 0")
errBaseFeeChangeDenominatorTooLow = errors.New("baseFeeChangeDenominator cannot be less than or equal to 0")
errMinBlockGasCostNegative = errors.New("minBlockGasCost cannot be less than 0")
errBlockGasCostStepNegative = errors.New("blockGasCostStep cannot be less than 0")
errMaxBlockGasCostNotUint64 = errors.New("maxBlockGasCost is not a valid uint64")
errGasLimitExceedsHashLength = errors.New("gasLimit exceeds hash length")
errTargetBlockRateExceedsHashLength = errors.New("targetBlockRate exceeds hash length")
errMinBaseFeeExceedsHashLength = errors.New("minBaseFee exceeds hash length")
errTargetGasExceedsHashLength = errors.New("targetGas exceeds hash length")
errBaseFeeChangeDenominatorExceedsHashLength = errors.New("baseFeeChangeDenominator exceeds hash length")
errMinBlockGasCostExceedsHashLength = errors.New("minBlockGasCost exceeds hash length")
errMaxBlockGasCostExceedsHashLength = errors.New("maxBlockGasCost exceeds hash length")
errBlockGasCostStepExceedsHashLength = errors.New("blockGasCostStep exceeds hash length")
)

// FeeConfig specifies the parameters for the dynamic fee algorithm, which determines the gas limit, base fee, and block gas cost of blocks
// on the network.
//
Expand Down Expand Up @@ -65,40 +93,40 @@ var EmptyFeeConfig = FeeConfig{}
func (f *FeeConfig) Verify() error {
switch {
case f.GasLimit == nil:
return errors.New("gasLimit cannot be nil")
return ErrGasLimitNil
case f.MinBaseFee == nil:
return errors.New("minBaseFee cannot be nil")
return errMinBaseFeeNil
case f.TargetGas == nil:
return errors.New("targetGas cannot be nil")
return errTargetGasNil
case f.BaseFeeChangeDenominator == nil:
return errors.New("baseFeeChangeDenominator cannot be nil")
return errBaseFeeChangeDenominatorNil
case f.MinBlockGasCost == nil:
return errors.New("minBlockGasCost cannot be nil")
return errMinBlockGasCostNil
case f.MaxBlockGasCost == nil:
return errors.New("maxBlockGasCost cannot be nil")
return errMaxBlockGasCostNil
case f.BlockGasCostStep == nil:
return errors.New("blockGasCostStep cannot be nil")
return errBlockGasCostStepNil
}

switch {
case f.GasLimit.Cmp(common.Big0) != 1:
return fmt.Errorf("gasLimit = %d cannot be less than or equal to 0", f.GasLimit)
return fmt.Errorf("%w: gasLimit = %d", ErrGasLimitTooLow, f.GasLimit)
case f.TargetBlockRate <= 0:
return fmt.Errorf("targetBlockRate = %d cannot be less than or equal to 0", f.TargetBlockRate)
return fmt.Errorf("%w: targetBlockRate = %d", errTargetBlockRateTooLow, f.TargetBlockRate)
case f.MinBaseFee.Cmp(common.Big0) == -1:
return fmt.Errorf("minBaseFee = %d cannot be less than 0", f.MinBaseFee)
return fmt.Errorf("%w: minBaseFee = %d", errMinBaseFeeNegative, f.MinBaseFee)
case f.TargetGas.Cmp(common.Big0) != 1:
return fmt.Errorf("targetGas = %d cannot be less than or equal to 0", f.TargetGas)
return fmt.Errorf("%w: targetGas = %d", errTargetGasTooLow, f.TargetGas)
case f.BaseFeeChangeDenominator.Cmp(common.Big0) != 1:
return fmt.Errorf("baseFeeChangeDenominator = %d cannot be less than or equal to 0", f.BaseFeeChangeDenominator)
return fmt.Errorf("%w: baseFeeChangeDenominator = %d", errBaseFeeChangeDenominatorTooLow, f.BaseFeeChangeDenominator)
case f.MinBlockGasCost.Cmp(common.Big0) == -1:
return fmt.Errorf("minBlockGasCost = %d cannot be less than 0", f.MinBlockGasCost)
return fmt.Errorf("%w: minBlockGasCost = %d", errMinBlockGasCostNegative, f.MinBlockGasCost)
case f.MinBlockGasCost.Cmp(f.MaxBlockGasCost) == 1:
return fmt.Errorf("minBlockGasCost = %d cannot be greater than maxBlockGasCost = %d", f.MinBlockGasCost, f.MaxBlockGasCost)
return fmt.Errorf("%w: minBlockGasCost = %d, maxBlockGasCost = %d", ErrMinBlockGasCostTooHigh, f.MinBlockGasCost, f.MaxBlockGasCost)
case f.BlockGasCostStep.Cmp(common.Big0) == -1:
return fmt.Errorf("blockGasCostStep = %d cannot be less than 0", f.BlockGasCostStep)
return fmt.Errorf("%w: blockGasCostStep = %d", errBlockGasCostStepNegative, f.BlockGasCostStep)
case !f.MaxBlockGasCost.IsUint64():
return fmt.Errorf("maxBlockGasCost = %d is not a valid uint64", f.MaxBlockGasCost)
return fmt.Errorf("%w: maxBlockGasCost = %d", errMaxBlockGasCostNotUint64, f.MaxBlockGasCost)
}
return f.checkByteLens()
}
Expand All @@ -122,28 +150,28 @@ func (f *FeeConfig) Equal(other *FeeConfig) bool {
// checkByteLens checks byte lengths against common.HashLen (32 bytes) and returns error
func (f *FeeConfig) checkByteLens() error {
if isBiggerThanHashLen(f.GasLimit) {
return fmt.Errorf("gasLimit exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errGasLimitExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(new(big.Int).SetUint64(f.TargetBlockRate)) {
return fmt.Errorf("targetBlockRate exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errTargetBlockRateExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(f.MinBaseFee) {
return fmt.Errorf("minBaseFee exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errMinBaseFeeExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(f.TargetGas) {
return fmt.Errorf("targetGas exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errTargetGasExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(f.BaseFeeChangeDenominator) {
return fmt.Errorf("baseFeeChangeDenominator exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errBaseFeeChangeDenominatorExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(f.MinBlockGasCost) {
return fmt.Errorf("minBlockGasCost exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errMinBlockGasCostExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(f.MaxBlockGasCost) {
return fmt.Errorf("maxBlockGasCost exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errMaxBlockGasCostExceedsHashLength, common.HashLength)
}
if isBiggerThanHashLen(f.BlockGasCostStep) {
return fmt.Errorf("blockGasCostStep exceeds %d bytes", common.HashLength)
return fmt.Errorf("%w: %d bytes", errBlockGasCostStepExceedsHashLength, common.HashLength)
}
return nil
}
Expand Down
65 changes: 30 additions & 35 deletions commontype/fee_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (

func TestVerify(t *testing.T) {
tests := []struct {
name string
config *FeeConfig
expectedError string
name string
config *FeeConfig
wantError error
}{
{
name: "nil gasLimit in FeeConfig",
Expand All @@ -30,42 +30,42 @@ func TestVerify(t *testing.T) {
MaxBlockGasCost: big.NewInt(1_000_000),
BlockGasCostStep: big.NewInt(200_000),
},
expectedError: "gasLimit cannot be nil",
wantError: ErrGasLimitNil,
},
{
name: "invalid GasLimit in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.GasLimit = big.NewInt(0); return &c }(),
expectedError: "gasLimit = 0 cannot be less than or equal to 0",
name: "invalid GasLimit in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.GasLimit = big.NewInt(0); return &c }(),
wantError: ErrGasLimitTooLow,
},
{
name: "invalid TargetBlockRate in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.TargetBlockRate = 0; return &c }(),
expectedError: "targetBlockRate = 0 cannot be less than or equal to 0",
name: "invalid TargetBlockRate in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.TargetBlockRate = 0; return &c }(),
wantError: errTargetBlockRateTooLow,
},
{
name: "invalid MinBaseFee in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.MinBaseFee = big.NewInt(-1); return &c }(),
expectedError: "minBaseFee = -1 cannot be less than 0",
name: "invalid MinBaseFee in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.MinBaseFee = big.NewInt(-1); return &c }(),
wantError: errMinBaseFeeNegative,
},
{
name: "invalid TargetGas in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.TargetGas = big.NewInt(0); return &c }(),
expectedError: "targetGas = 0 cannot be less than or equal to 0",
name: "invalid TargetGas in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.TargetGas = big.NewInt(0); return &c }(),
wantError: errTargetGasTooLow,
},
{
name: "invalid BaseFeeChangeDenominator in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.BaseFeeChangeDenominator = big.NewInt(0); return &c }(),
expectedError: "baseFeeChangeDenominator = 0 cannot be less than or equal to 0",
name: "invalid BaseFeeChangeDenominator in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.BaseFeeChangeDenominator = big.NewInt(0); return &c }(),
wantError: errBaseFeeChangeDenominatorTooLow,
},
{
name: "invalid MinBlockGasCost in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.MinBlockGasCost = big.NewInt(-1); return &c }(),
expectedError: "minBlockGasCost = -1 cannot be less than 0",
name: "invalid MinBlockGasCost in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.MinBlockGasCost = big.NewInt(-1); return &c }(),
wantError: errMinBlockGasCostNegative,
},
{
name: "valid FeeConfig",
config: &ValidTestFeeConfig,
expectedError: "",
name: "valid FeeConfig",
config: &ValidTestFeeConfig,
wantError: nil,
},
{
name: "MinBlockGasCost bigger than MaxBlockGasCost in FeeConfig",
Expand All @@ -75,24 +75,19 @@ func TestVerify(t *testing.T) {
c.MaxBlockGasCost = big.NewInt(1)
return &c
}(),
expectedError: "minBlockGasCost = 2 cannot be greater than maxBlockGasCost = 1",
wantError: ErrMinBlockGasCostTooHigh,
},
{
name: "invalid BlockGasCostStep in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.BlockGasCostStep = big.NewInt(-1); return &c }(),
expectedError: "blockGasCostStep = -1 cannot be less than 0",
name: "invalid BlockGasCostStep in FeeConfig",
config: func() *FeeConfig { c := ValidTestFeeConfig; c.BlockGasCostStep = big.NewInt(-1); return &c }(),
wantError: errBlockGasCostStepNegative,
},
}

for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
err := test.config.Verify()
if test.expectedError == "" {
require.NoError(t, err)
} else {
require.Error(t, err)
require.Contains(t, err.Error(), test.expectedError)
}
require.ErrorIs(t, err, test.wantError)
})
}
}
Expand Down
3 changes: 2 additions & 1 deletion network/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (

var (
errAcquiringSemaphore = errors.New("error acquiring semaphore")
errEmptyNodeID = errors.New("cannot send request to empty nodeID")
errExpiredRequest = errors.New("expired request")
errNoPeersFound = errors.New("no peers found matching version")
_ Network = (*network)(nil)
Expand Down Expand Up @@ -191,7 +192,7 @@ func (n *network) SendAppRequestAny(ctx context.Context, minVersion *version.App
// SendAppRequest sends request message bytes to specified nodeID, notifying the responseHandler on response or failure
func (n *network) SendAppRequest(ctx context.Context, nodeID ids.NodeID, request []byte, responseHandler message.ResponseHandler) error {
if nodeID == ids.EmptyNodeID {
return fmt.Errorf("cannot send request to empty nodeID, nodeID=%s, requestLen=%d", nodeID, len(request))
return fmt.Errorf("%w, nodeID=%s, requestLen=%d", errEmptyNodeID, nodeID, len(request))
}

// If the context was cancelled, we can skip sending this request.
Expand Down
12 changes: 6 additions & 6 deletions network/network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,8 @@ func TestRequestRequestsRoutingAndResponse(t *testing.T) {
}

// ensure empty nodeID is not allowed
require.ErrorContains(t,
net.SendAppRequest(t.Context(), ids.EmptyNodeID, []byte("hello there"), nil),
"cannot send request to empty nodeID",
)
err = net.SendAppRequest(t.Context(), ids.EmptyNodeID, []byte("hello there"), nil)
require.ErrorIs(t, err, errEmptyNodeID)
}

func TestAppRequestOnShutdown(t *testing.T) {
Expand Down Expand Up @@ -551,7 +549,8 @@ func TestNetworkPropagatesRequestHandlerError(t *testing.T) {
ctx := snowtest.Context(t, snowtest.CChainID)
clientNetwork, err := NewNetwork(ctx, sender, codecManager, 1, prometheus.NewRegistry())
require.NoError(t, err)
clientNetwork.SetRequestHandler(&testRequestHandler{err: errors.New("fail")}) // Return an error from the request handler
errTest := errors.New("test error")
clientNetwork.SetRequestHandler(&testRequestHandler{err: errTest}) // Return an error from the request handler

require.NoError(t, clientNetwork.Connected(t.Context(), nodeID, defaultPeerVersion))

Expand All @@ -562,7 +561,8 @@ func TestNetworkPropagatesRequestHandlerError(t *testing.T) {
require.NoError(t, err)

// Check that if the request handler returns an error, it is propagated as a fatal error.
require.ErrorContains(t, clientNetwork.AppRequest(t.Context(), nodeID, requestID, time.Now().Add(time.Second), requestMessage), "fail")
err = clientNetwork.AppRequest(t.Context(), nodeID, requestID, time.Now().Add(time.Second), requestMessage)
require.ErrorIs(t, err, errTest)
}

func TestNetworkAppRequestAfterShutdown(t *testing.T) {
Expand Down
Loading
Loading