diff --git a/factory/api/apiResolverFactory_test.go b/factory/api/apiResolverFactory_test.go index 6f0d1026304..94683580098 100644 --- a/factory/api/apiResolverFactory_test.go +++ b/factory/api/apiResolverFactory_test.go @@ -94,6 +94,11 @@ func createMockArgs(t *testing.T) *api.ApiResolverArgs { GeneralConfig: &cfg, EpochConfig: &config.EpochConfig{}, EconomicsConfig: &economicsConfig, + SystemSCConfig: &config.SystemSmartContractsConfig{ + ESDTSystemSCConfig: config.ESDTSystemSCConfig{ + WhiteListedCrossChainMintAddresses: []string{"erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c"}, + }, + }, }, CoreComponents: coreComponents, DataComponents: dataComponents, @@ -365,8 +370,12 @@ func createMockSCQueryElementArgs() api.SCQueryElementArgs { return gasSchedule }, }, - MessageSigVerifier: &testscommon.MessageSignVerifierMock{}, - SystemSCConfig: &config.SystemSmartContractsConfig{}, + MessageSigVerifier: &testscommon.MessageSignVerifierMock{}, + SystemSCConfig: &config.SystemSmartContractsConfig{ + ESDTSystemSCConfig: config.ESDTSystemSCConfig{ + WhiteListedCrossChainMintAddresses: []string{"erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c"}, + }, + }, Bootstrapper: testsMocks.NewTestBootstrapperMock(), AllowVMQueriesChan: make(chan struct{}, 1), WorkingDir: "", diff --git a/factory/processing/processComponents_test.go b/factory/processing/processComponents_test.go index a1654ce3ba3..dbf4fb6ccba 100644 --- a/factory/processing/processComponents_test.go +++ b/factory/processing/processComponents_test.go @@ -119,8 +119,9 @@ func createMockProcessComponentsFactoryArgs() processComp.ProcessComponentsFacto MaxRating: 100, SystemSCConfig: &config.SystemSmartContractsConfig{ ESDTSystemSCConfig: config.ESDTSystemSCConfig{ - BaseIssuingCost: "1000", - OwnerAddress: "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c", + BaseIssuingCost: "1000", + OwnerAddress: "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c", + WhiteListedCrossChainMintAddresses: []string{"erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c"}, }, GovernanceSystemSCConfig: config.GovernanceSystemSCConfig{ V1: config.GovernanceSystemSCConfigV1{ diff --git a/genesis/process/genesisBlockCreator_test.go b/genesis/process/genesisBlockCreator_test.go index b7b788f0d37..da11eeea852 100644 --- a/genesis/process/genesisBlockCreator_test.go +++ b/genesis/process/genesisBlockCreator_test.go @@ -124,8 +124,9 @@ func createMockArgument( }, SystemSCConfig: config.SystemSmartContractsConfig{ ESDTSystemSCConfig: config.ESDTSystemSCConfig{ - BaseIssuingCost: "5000000000000000000000", - OwnerAddress: "erd1932eft30w753xyvme8d49qejgkjc09n5e49w4mwdjtm0neld797su0dlxp", + BaseIssuingCost: "5000000000000000000000", + OwnerAddress: "erd1932eft30w753xyvme8d49qejgkjc09n5e49w4mwdjtm0neld797su0dlxp", + WhiteListedCrossChainMintAddresses: []string{"3132333435363738393031323334353637383930313233343536373839303234"}, }, GovernanceSystemSCConfig: config.GovernanceSystemSCConfig{ V1: config.GovernanceSystemSCConfigV1{ diff --git a/go.mod b/go.mod index ff13cfcc12b..fc4985eec32 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/multiversx/mx-chain-logger-go v1.0.15-0.20240508072523-3f00a726af57 github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00 github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f - github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240517120416-65198a9beff1 + github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240520110500-40b50af7d284 github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240509104139-8b0eaa8a85d1 github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240509103859-89de3c5da36b github.com/multiversx/mx-chain-vm-v1_3-go v1.3.69-0.20240509104009-598a37ff36b9 diff --git a/go.sum b/go.sum index 2e330c85dec..2b0d5f4e0b7 100644 --- a/go.sum +++ b/go.sum @@ -399,8 +399,8 @@ github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00 github.com/multiversx/mx-chain-scenario-go v1.4.4-0.20240509103754-9e8129721f00/go.mod h1:pnIIfWopbDMQ1EW5Ddc6KDMqv8Qtx+hxbH9rorHpCyo= github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f h1:yd/G8iPBGOEAwbaS8zndJpO6bQk7Tk72ZhmlqRasThI= github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240508073549-dcb8e6e0370f/go.mod h1:E6nfj9EQzGxWDGM3Dn6eZWRC3qFy1G8IqOsYsBOcgWw= -github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240517120416-65198a9beff1 h1:6l/v7beMcNVxIdGMkb75XsYtpe2tuDnGlAEOmMcqmhg= -github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240517120416-65198a9beff1/go.mod h1:SLOTnC9jwUQnJaDaLCpR5EfyLV+YizkzA6lGsba+Q1s= +github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240520110500-40b50af7d284 h1:8WKI5l1aIkNXyO+ErY2NkkIp2s7n+2zCwRbYWwb8sdE= +github.com/multiversx/mx-chain-vm-common-go v1.5.13-0.20240520110500-40b50af7d284/go.mod h1:SLOTnC9jwUQnJaDaLCpR5EfyLV+YizkzA6lGsba+Q1s= github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240509104139-8b0eaa8a85d1 h1:5/h1i7Xd/JH9CiO3ZqvzAjdze+mAbar5sWkh2UqfLgI= github.com/multiversx/mx-chain-vm-go v1.5.30-0.20240509104139-8b0eaa8a85d1/go.mod h1:N3Oa8QeeHlSip4nbESQpVSLgi/WxtgIwvqfXIZm6gDs= github.com/multiversx/mx-chain-vm-v1_2-go v1.2.68-0.20240509103859-89de3c5da36b h1:puYO0lUyPGA5kZqsiDjGa+daDGQwj9xFs0S5urhZjU8= diff --git a/integrationTests/testProcessorNode.go b/integrationTests/testProcessorNode.go index 905ea48638b..b447f89213f 100644 --- a/integrationTests/testProcessorNode.go +++ b/integrationTests/testProcessorNode.go @@ -57,7 +57,6 @@ import ( "github.com/multiversx/mx-chain-go/genesis/parsing" "github.com/multiversx/mx-chain-go/genesis/process/disabled" "github.com/multiversx/mx-chain-go/integrationTests/mock" - "github.com/multiversx/mx-chain-go/integrationTests/vm/wasm" "github.com/multiversx/mx-chain-go/node" "github.com/multiversx/mx-chain-go/node/external" "github.com/multiversx/mx-chain-go/node/nodeDebugFactory" @@ -218,6 +217,11 @@ var testProtocolSustainabilityAddress = "erd1932eft30w753xyvme8d49qejgkjc09n5e49 // delegation manager system smartcontract var DelegationManagerConfigChangeAddress = "erd1vxy22x0fj4zv6hktmydg8vpfh6euv02cz4yg0aaws6rrad5a5awqgqky80" +// CrossChainAddresses - +var CrossChainAddresses = map[string]struct{}{ + "whiteListedAddress": {}, +} + // sizeCheckDelta the maximum allowed bufer overhead (p2p unmarshalling) const sizeCheckDelta = 100 @@ -877,7 +881,7 @@ func (tpn *TestProcessorNode) createFullSCQueryService(gasMap map[string]map[str EnableEpochsHandler: tpn.EnableEpochsHandler, MaxNumNodesInTransferRole: 100, GuardedAccountHandler: tpn.GuardedAccountHandler, - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: CrossChainAddresses, } argsBuiltIn.AutomaticCrawlerAddresses = GenerateOneAddressPerShard(argsBuiltIn.ShardCoordinator) builtInFuncFactory, _ := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) @@ -1612,7 +1616,7 @@ func (tpn *TestProcessorNode) initInnerProcessors(gasMap map[string]map[string]u EnableEpochsHandler: tpn.EnableEpochsHandler, MaxNumNodesInTransferRole: 100, GuardedAccountHandler: tpn.GuardedAccountHandler, - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: CrossChainAddresses, } argsBuiltIn.AutomaticCrawlerAddresses = GenerateOneAddressPerShard(argsBuiltIn.ShardCoordinator) builtInFuncFactory, _ := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) @@ -1850,7 +1854,7 @@ func (tpn *TestProcessorNode) initMetaInnerProcessors(gasMap map[string]map[stri EnableEpochsHandler: tpn.EnableEpochsHandler, MaxNumNodesInTransferRole: 100, GuardedAccountHandler: tpn.GuardedAccountHandler, - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: CrossChainAddresses, } argsBuiltIn.AutomaticCrawlerAddresses = GenerateOneAddressPerShard(argsBuiltIn.ShardCoordinator) builtInFuncFactory, _ := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) diff --git a/integrationTests/testProcessorNodeWithTestWebServer.go b/integrationTests/testProcessorNodeWithTestWebServer.go index 06095e2c3e4..b81cb0e41eb 100644 --- a/integrationTests/testProcessorNodeWithTestWebServer.go +++ b/integrationTests/testProcessorNodeWithTestWebServer.go @@ -12,7 +12,6 @@ import ( "github.com/multiversx/mx-chain-go/config" nodeFacade "github.com/multiversx/mx-chain-go/facade" "github.com/multiversx/mx-chain-go/integrationTests/mock" - "github.com/multiversx/mx-chain-go/integrationTests/vm/wasm" "github.com/multiversx/mx-chain-go/node/external" "github.com/multiversx/mx-chain-go/node/external/blockAPI" "github.com/multiversx/mx-chain-go/node/external/transactionAPI" @@ -148,7 +147,7 @@ func createFacadeComponents(tpn *TestProcessorNode) nodeFacade.ApiResolver { EnableEpochsHandler: tpn.EnableEpochsHandler, MaxNumNodesInTransferRole: 100, GuardedAccountHandler: tpn.GuardedAccountHandler, - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: CrossChainAddresses, } argsBuiltIn.AutomaticCrawlerAddresses = GenerateOneAddressPerShard(argsBuiltIn.ShardCoordinator) builtInFuncs, err := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) diff --git a/integrationTests/vm/staking/systemSCCreator.go b/integrationTests/vm/staking/systemSCCreator.go index dddc9fb586b..27992827232 100644 --- a/integrationTests/vm/staking/systemSCCreator.go +++ b/integrationTests/vm/staking/systemSCCreator.go @@ -13,7 +13,7 @@ import ( "github.com/multiversx/mx-chain-go/epochStart/notifier" "github.com/multiversx/mx-chain-go/factory" "github.com/multiversx/mx-chain-go/genesis/process/disabled" - "github.com/multiversx/mx-chain-go/integrationTests/vm/wasm" + vmConst "github.com/multiversx/mx-chain-go/integrationTests/vm" "github.com/multiversx/mx-chain-go/process" metaProcess "github.com/multiversx/mx-chain-go/process/factory/metachain" "github.com/multiversx/mx-chain-go/process/peer" @@ -153,7 +153,7 @@ func createBlockChainHook( MaxNumNodesInTransferRole: 1, GuardedAccountHandler: &guardianMocks.GuardedAccountHandlerStub{}, MapDNSV2Addresses: make(map[string]struct{}), - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: vmConst.CrossChainAddresses, } builtInFunctionsContainer, _ := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) diff --git a/integrationTests/vm/testInitializer.go b/integrationTests/vm/testInitializer.go index 7a45fedaaf8..3155ca992df 100644 --- a/integrationTests/vm/testInitializer.go +++ b/integrationTests/vm/testInitializer.go @@ -29,7 +29,6 @@ import ( processDisabled "github.com/multiversx/mx-chain-go/genesis/process/disabled" "github.com/multiversx/mx-chain-go/integrationTests" "github.com/multiversx/mx-chain-go/integrationTests/mock" - "github.com/multiversx/mx-chain-go/integrationTests/vm/wasm" "github.com/multiversx/mx-chain-go/node/external" "github.com/multiversx/mx-chain-go/process" "github.com/multiversx/mx-chain-go/process/block/postprocess" @@ -89,6 +88,11 @@ const DNSV2Address = "erd1qqqqqqqqqqqqqpgqcy67yanvwpepqmerkq6m8pgav0tlvgwxjmdq4h // DNSV2DeployerAddress defines the address of the deployer for the DNS v2 contracts const DNSV2DeployerAddress = "erd1uzk2g5rhvg8prk9y50d0q7qsxg7tm7f320q0q4qlpmfu395wjmdqqy0n9q" +// CrossChainAddresses - +var CrossChainAddresses = map[string]struct{}{ + "whiteListedAddress": {}, +} + // TestAddressPubkeyConverter represents an address public key converter var TestAddressPubkeyConverter, _ = pubkeyConverter.NewBech32PubkeyConverter(32, "erd") @@ -567,7 +571,7 @@ func CreateVMAndBlockchainHookAndDataPool( EnableEpochsHandler: enableEpochsHandler, MaxNumNodesInTransferRole: 100, GuardedAccountHandler: guardedAccountHandler, - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: CrossChainAddresses, } argsBuiltIn.AutomaticCrawlerAddresses = integrationTests.GenerateOneAddressPerShard(argsBuiltIn.ShardCoordinator) builtInFuncFactory, _ := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) @@ -662,7 +666,7 @@ func CreateVMAndBlockchainHookMeta( EnableEpochsHandler: enableEpochsHandler, MaxNumNodesInTransferRole: 100, GuardedAccountHandler: guardedAccountHandler, - MapWhiteListedCrossChainMintAddresses: wasm.CrossChainAddresses, + MapWhiteListedCrossChainMintAddresses: CrossChainAddresses, } argsBuiltIn.AutomaticCrawlerAddresses = integrationTests.GenerateOneAddressPerShard(argsBuiltIn.ShardCoordinator) builtInFuncFactory, _ := builtInFunctions.CreateBuiltInFunctionsFactory(argsBuiltIn) diff --git a/testscommon/components/components.go b/testscommon/components/components.go index 0e3dcc14cd1..c07ec436068 100644 --- a/testscommon/components/components.go +++ b/testscommon/components/components.go @@ -523,8 +523,9 @@ func GetProcessArgs( ImportStartHandler: &testscommon.ImportStartHandlerStub{}, SystemSCConfig: &config.SystemSmartContractsConfig{ ESDTSystemSCConfig: config.ESDTSystemSCConfig{ - BaseIssuingCost: "1000", - OwnerAddress: "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c", + BaseIssuingCost: "1000", + OwnerAddress: "erd1fpkcgel4gcmh8zqqdt043yfcn5tyx8373kg6q2qmkxzu4dqamc0swts65c", + WhiteListedCrossChainMintAddresses: []string{"erd1he8wwxn4az3j82p7wwqsdk794dm7hcrwny6f8dfegkfla34udx7qrf7xje"}, }, GovernanceSystemSCConfig: config.GovernanceSystemSCConfig{ V1: config.GovernanceSystemSCConfigV1{