Skip to content

Commit

Permalink
Merge branch 'MX-15445-integrate-local-mint-burn-vm-common' into esdt…
Browse files Browse the repository at this point in the history
…-prefix-bridge
  • Loading branch information
mariusmihaic committed May 20, 2024
2 parents e66af7e + 935d5bd commit 2ed6e2d
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 22 deletions.
13 changes: 11 additions & 2 deletions factory/api/apiResolverFactory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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: "",
Expand Down
5 changes: 3 additions & 2 deletions factory/processing/processComponents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
5 changes: 3 additions & 2 deletions genesis/process/genesisBlockCreator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
12 changes: 8 additions & 4 deletions integrationTests/testProcessorNode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions integrationTests/testProcessorNodeWithTestWebServer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions integrationTests/vm/staking/systemSCCreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 7 additions & 3 deletions integrationTests/vm/testInitializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions testscommon/components/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 2ed6e2d

Please sign in to comment.