From b9953f4242eaaf5b34b31127ee01cf117caaaea6 Mon Sep 17 00:00:00 2001 From: jules01 Date: Fri, 31 Mar 2023 20:43:54 +0300 Subject: [PATCH] refactor part 2 for the IsInterfaceNil tests --- node/external/logs/logsFacade_test.go | 5 ++--- node/external/nodeApiResolver_test.go | 5 ++--- node/external/timemachine/fee/feeComputer_test.go | 5 ++--- node/node_test.go | 4 ++-- node/trieIterators/delegatedListProcessor_test.go | 5 ++--- node/trieIterators/directStakedListProcessor_test.go | 5 ++--- 6 files changed, 12 insertions(+), 17 deletions(-) diff --git a/node/external/logs/logsFacade_test.go b/node/external/logs/logsFacade_test.go index 61da4911aa8..21d11f99c59 100644 --- a/node/external/logs/logsFacade_test.go +++ b/node/external/logs/logsFacade_test.go @@ -4,7 +4,6 @@ import ( "testing" "github.com/multiversx/mx-chain-core-go/core" - "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/data/transaction" "github.com/multiversx/mx-chain-core-go/marshal" "github.com/multiversx/mx-chain-go/testscommon" @@ -149,7 +148,7 @@ func TestLogsFacade_IsInterfaceNil(t *testing.T) { t.Parallel() var lf *logsFacade - require.True(t, check.IfNil(lf)) + require.True(t, lf.IsInterfaceNil()) arguments := ArgsNewLogsFacade{ StorageService: genericMocks.NewChainStorerMock(7), @@ -157,5 +156,5 @@ func TestLogsFacade_IsInterfaceNil(t *testing.T) { PubKeyConverter: testscommon.NewPubkeyConverterMock(32), } lf, _ = NewLogsFacade(arguments) - require.False(t, check.IfNil(lf)) + require.False(t, lf.IsInterfaceNil()) } diff --git a/node/external/nodeApiResolver_test.go b/node/external/nodeApiResolver_test.go index 2efe85f6db7..1132c7bbdcf 100644 --- a/node/external/nodeApiResolver_test.go +++ b/node/external/nodeApiResolver_test.go @@ -7,7 +7,6 @@ import ( "math/big" "testing" - "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/data/api" "github.com/multiversx/mx-chain-core-go/data/transaction" "github.com/multiversx/mx-chain-go/common" @@ -681,9 +680,9 @@ func TestNodeApiResolver_IsInterfaceNil(t *testing.T) { t.Parallel() nar, _ := external.NewNodeApiResolver(external.ArgNodeApiResolver{}) - require.True(t, check.IfNil(nar)) + require.True(t, nar.IsInterfaceNil()) arg := createMockArgs() nar, _ = external.NewNodeApiResolver(arg) - require.False(t, check.IfNil(nar)) + require.False(t, nar.IsInterfaceNil()) } diff --git a/node/external/timemachine/fee/feeComputer_test.go b/node/external/timemachine/fee/feeComputer_test.go index 33581dbc338..fb91db19049 100644 --- a/node/external/timemachine/fee/feeComputer_test.go +++ b/node/external/timemachine/fee/feeComputer_test.go @@ -6,7 +6,6 @@ import ( "sync" "testing" - "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/data/transaction" "github.com/multiversx/mx-chain-go/config" "github.com/multiversx/mx-chain-go/process" @@ -221,7 +220,7 @@ func TestFeeComputer_IsInterfaceNil(t *testing.T) { t.Parallel() var fc *feeComputer - require.True(t, check.IfNil(fc)) + require.True(t, fc.IsInterfaceNil()) arguments := ArgsNewFeeComputer{ BuiltInFunctionsCostHandler: &testscommon.BuiltInCostHandlerStub{}, @@ -229,5 +228,5 @@ func TestFeeComputer_IsInterfaceNil(t *testing.T) { } fc, _ = NewFeeComputer(arguments) - require.False(t, check.IfNil(fc)) + require.False(t, fc.IsInterfaceNil()) } diff --git a/node/node_test.go b/node/node_test.go index bbc8026ee5f..057bc262b17 100644 --- a/node/node_test.go +++ b/node/node_test.go @@ -4509,8 +4509,8 @@ func TestNode_IsInterfaceNil(t *testing.T) { t.Parallel() var n *node.Node - require.True(t, check.IfNil(n)) + require.True(t, n.IsInterfaceNil()) n, _ = node.NewNode() - require.False(t, check.IfNil(n)) + require.False(t, n.IsInterfaceNil()) } diff --git a/node/trieIterators/delegatedListProcessor_test.go b/node/trieIterators/delegatedListProcessor_test.go index 81c9209257c..c51b926ce59 100644 --- a/node/trieIterators/delegatedListProcessor_test.go +++ b/node/trieIterators/delegatedListProcessor_test.go @@ -9,7 +9,6 @@ import ( "testing" "time" - "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/core/keyValStorage" "github.com/multiversx/mx-chain-core-go/data/api" "github.com/multiversx/mx-chain-go/common" @@ -216,10 +215,10 @@ func TestDelegatedListProcessor_IsInterfaceNil(t *testing.T) { t.Parallel() var dlp *delegatedListProcessor - require.True(t, check.IfNil(dlp)) + require.True(t, dlp.IsInterfaceNil()) dlp, _ = NewDelegatedListProcessor(createMockArgs()) - require.False(t, check.IfNil(dlp)) + require.False(t, dlp.IsInterfaceNil()) } func createDelegationScAccount(address []byte, leaves [][]byte, rootHash []byte, timeSleep time.Duration) state.UserAccountHandler { diff --git a/node/trieIterators/directStakedListProcessor_test.go b/node/trieIterators/directStakedListProcessor_test.go index 36b4297c8c3..a56311d9108 100644 --- a/node/trieIterators/directStakedListProcessor_test.go +++ b/node/trieIterators/directStakedListProcessor_test.go @@ -9,7 +9,6 @@ import ( "testing" "time" - "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/core/keyValStorage" "github.com/multiversx/mx-chain-core-go/data/api" "github.com/multiversx/mx-chain-go/common" @@ -171,8 +170,8 @@ func TestDirectStakedListProcessor_IsInterfaceNil(t *testing.T) { t.Parallel() var dslp *directStakedListProcessor - require.True(t, check.IfNil(dslp)) + require.True(t, dslp.IsInterfaceNil()) dslp, _ = NewDirectStakedListProcessor(createMockArgs()) - require.False(t, check.IfNil(dslp)) + require.False(t, dslp.IsInterfaceNil()) }