From e65fac79f1867b7b49812f3bf17d80c2162440b0 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Mon, 22 Jan 2024 15:44:46 -0500 Subject: [PATCH] Fix `require.ErrorIs` argument order (#2645) --- network/p2p/network_test.go | 2 +- vms/proposervm/block_test.go | 6 +++--- vms/proposervm/vm_regression_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/network/p2p/network_test.go b/network/p2p/network_test.go index 3bf902c38035..40dc0ba54056 100644 --- a/network/p2p/network_test.go +++ b/network/p2p/network_test.go @@ -614,7 +614,7 @@ func TestNodeSamplerClientOption(t *testing.T) { close(done) } - require.ErrorIs(tt.expectedErr, err) + require.ErrorIs(err, tt.expectedErr) <-done }) } diff --git a/vms/proposervm/block_test.go b/vms/proposervm/block_test.go index fea216120811..939706f157e5 100644 --- a/vms/proposervm/block_test.go +++ b/vms/proposervm/block_test.go @@ -336,7 +336,7 @@ func TestPreDurangoNonValidatorNodeBlockBuiltDelaysTests(t *testing.T) { proVM.Set(localTime) _, err := proVM.BuildBlock(ctx) - require.ErrorIs(errProposerWindowNotStarted, err) + require.ErrorIs(err, errProposerWindowNotStarted) } { @@ -346,7 +346,7 @@ func TestPreDurangoNonValidatorNodeBlockBuiltDelaysTests(t *testing.T) { proVM.Set(localTime) _, err := proVM.BuildBlock(ctx) - require.ErrorIs(errProposerWindowNotStarted, err) + require.ErrorIs(err, errProposerWindowNotStarted) } { @@ -356,7 +356,7 @@ func TestPreDurangoNonValidatorNodeBlockBuiltDelaysTests(t *testing.T) { proVM.Set(localTime) _, err := proVM.BuildBlock(ctx) - require.ErrorIs(errProposerWindowNotStarted, err) + require.ErrorIs(err, errProposerWindowNotStarted) } { diff --git a/vms/proposervm/vm_regression_test.go b/vms/proposervm/vm_regression_test.go index 168dd913d22a..ac34df120641 100644 --- a/vms/proposervm/vm_regression_test.go +++ b/vms/proposervm/vm_regression_test.go @@ -77,5 +77,5 @@ func TestProposerVMInitializeShouldFailIfInnerVMCantVerifyItsHeightIndex(t *test nil, nil, ) - require.ErrorIs(customError, err) + require.ErrorIs(err, customError) }