Skip to content

Commit

Permalink
unit test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
axenteoctavian committed Apr 30, 2024
1 parent 6b1f8c9 commit 5dd8d69
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions factory/vm/sovereignVmContainerShardCreator_test.go
Expand Up @@ -14,11 +14,11 @@ import (
"github.com/stretchr/testify/require"
)

func createSovereignRunTypeComponents() runType.RunTypeComponentsHolder {
coreComp := componentsMock.GetSovereignCoreComponents()
func createRunTypeComponents() runType.RunTypeComponentsHolder {
coreComp := componentsMock.GetCoreComponents()
cryptoComp := componentsMock.GetCryptoComponents(coreComp)

return componentsMock.GetSovereignRunTypeComponents(coreComp, cryptoComp)
return componentsMock.GetRunTypeComponents(coreComp, cryptoComp)
}

func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
Expand All @@ -27,7 +27,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
t.Run("should work", func(t *testing.T) {
t.Parallel()
bhhc := &factory.BlockChainHookHandlerFactoryMock{}
runTypeComponents := createSovereignRunTypeComponents()
runTypeComponents := createRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(bhhc, runTypeComponents.VmContainerMetaFactoryCreator(), runTypeComponents.VmContainerShardFactoryCreator())
require.Nil(t, err)
require.False(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -36,7 +36,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
t.Run("nil blockChainHookHandlerCreator", func(t *testing.T) {
t.Parallel()

runTypeComponents := createSovereignRunTypeComponents()
runTypeComponents := createRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(nil, runTypeComponents.VmContainerMetaFactoryCreator(), runTypeComponents.VmContainerShardFactoryCreator())
require.ErrorIs(t, err, process.ErrNilBlockChainHook)
require.True(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -46,7 +46,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
t.Parallel()

bhhc := &factory.BlockChainHookHandlerFactoryMock{}
runTypeComponents := createSovereignRunTypeComponents()
runTypeComponents := createRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(bhhc, nil, runTypeComponents.VmContainerShardFactoryCreator())
require.ErrorIs(t, err, vm.ErrNilVmContainerMetaCreator)
require.True(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -56,7 +56,7 @@ func TestNewSovereignVmContainerShardCreatorFactory(t *testing.T) {
t.Parallel()

bhhc := &factory.BlockChainHookHandlerFactoryMock{}
runTypeComponents := createSovereignRunTypeComponents()
runTypeComponents := createRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(bhhc, runTypeComponents.VmContainerMetaFactoryCreator(), nil)
require.ErrorIs(t, err, vm.ErrNilVmContainerShardCreator)
require.True(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand All @@ -67,7 +67,7 @@ func TestNewSovereignVmContainerShardFactory_CreateVmContainerFactoryShard(t *te
t.Parallel()

bhhc := &factory.BlockChainHookHandlerFactoryMock{}
runTypeComponents := createSovereignRunTypeComponents()
runTypeComponents := createRunTypeComponents()
sovereignVmContainerShardFactory, err := vm.NewSovereignVmContainerShardFactory(bhhc, runTypeComponents.VmContainerMetaFactoryCreator(), runTypeComponents.VmContainerShardFactoryCreator())
require.Nil(t, err)
require.False(t, sovereignVmContainerShardFactory.IsInterfaceNil())
Expand Down

0 comments on commit 5dd8d69

Please sign in to comment.