From 487d8387f1b2faba91f067b6c6c57dd519d13863 Mon Sep 17 00:00:00 2001 From: Konstantin Sherbakov Date: Thu, 8 Apr 2021 17:11:18 +0700 Subject: [PATCH] refactor(*): replace RoyaltiesRegistry.sol from exchange-v2 --- exchange-v2/migrations/2_initial_ExchangeV2.js | 4 ++-- exchange-v2/test-exchangev2-rarible.sh | 1 + exchange-v2/test-rarible-transfer-manager.sh | 1 + exchange-v2/test-transfer-executor.sh | 9 ++++++++- .../contracts/v2/TestRoyaltiesRegistry.sol} | 2 +- exchange-v2/test/v2/ExchangeV2.rarible.test.js | 4 ++-- exchange-v2/test/v2/RaribleManager.test.js | 4 ++-- 7 files changed, 17 insertions(+), 8 deletions(-) rename exchange-v2/{contracts/exchange/v2/RoyaltiesRegistry.sol => test/contracts/v2/TestRoyaltiesRegistry.sol} (98%) diff --git a/exchange-v2/migrations/2_initial_ExchangeV2.js b/exchange-v2/migrations/2_initial_ExchangeV2.js index fc2040462..e0fe5e4aa 100644 --- a/exchange-v2/migrations/2_initial_ExchangeV2.js +++ b/exchange-v2/migrations/2_initial_ExchangeV2.js @@ -3,7 +3,7 @@ const { deployProxy } = require('@openzeppelin/truffle-upgrades'); const ExchangeV2 = artifacts.require('ExchangeV2'); const ERC20TransferProxy = artifacts.require('ERC20TransferProxy'); const TransferProxy = artifacts.require('TransferProxy'); -const RoyaltiesRegistry = artifacts.require("RoyaltiesRegistry.sol"); +const TestRoyaltiesRegistry = artifacts.require("TestRoyaltiesRegistry.sol"); let settings = { "default": { @@ -25,7 +25,7 @@ module.exports = async function (deployer, network) { .catch(() => deployProxy(ERC20TransferProxy, [], { deployer, initializer: '__ERC20TransferProxy_init' })); const transferProxy = await TransferProxy.deployed() .catch(() => deployProxy(TransferProxy, [], { deployer, initializer: '__TransferProxy_init' })); - const royaltiesRegistry = await RoyaltiesRegistry.new(); + const royaltiesRegistry = await TestRoyaltiesRegistry.new(); await deployProxy( ExchangeV2, diff --git a/exchange-v2/test-exchangev2-rarible.sh b/exchange-v2/test-exchangev2-rarible.sh index 0f03f172b..8abf46913 100755 --- a/exchange-v2/test-exchangev2-rarible.sh +++ b/exchange-v2/test-exchangev2-rarible.sh @@ -8,4 +8,5 @@ truffle test \ ./test/contracts/tokens/TestERC721WithRoyaltiesV1.sol \ ./test/contracts/v2/LibOrderTest.sol \ ./test/contracts/v2/RaribleTransferManagerTest.sol \ + ./test/contracts/v2/TestRoyaltiesRegistry.sol \ ./test/contracts/tokens/TestERC721WithRoyaltyV1OwnableUpgradeable.sol diff --git a/exchange-v2/test-rarible-transfer-manager.sh b/exchange-v2/test-rarible-transfer-manager.sh index 3df02f817..bf130db3b 100755 --- a/exchange-v2/test-rarible-transfer-manager.sh +++ b/exchange-v2/test-rarible-transfer-manager.sh @@ -7,6 +7,7 @@ truffle test \ ./test/contracts/tokens/TestERC1155.sol \ ./test/contracts/v2/RaribleTransferManagerTest.sol \ ./test/contracts/v2/LibOrderTest.sol \ + ./test/contracts/v2/TestRoyaltiesRegistry.sol \ ./test/contracts/tokens/TestERC721WithRoyaltiesV1.sol \ ./test/contracts/tokens/TestERC721WithRoyaltiesV2.sol \ ./test/contracts/tokens/TestERC1155WithRoyaltiesV1.sol \ diff --git a/exchange-v2/test-transfer-executor.sh b/exchange-v2/test-transfer-executor.sh index 6e8801b43..bb40d3564 100755 --- a/exchange-v2/test-transfer-executor.sh +++ b/exchange-v2/test-transfer-executor.sh @@ -1,2 +1,9 @@ #!/usr/bin/env bash -truffle test ./test/v2/TransferExecutor.test.js ./test/contracts/v2/TransferExecutorTest.sol ./test/contracts/tokens/TestERC20.sol ./test/contracts/tokens/TestERC721.sol ./test/contracts/tokens/TestERC721Dep.sol ./test/contracts/tokens/TestERC1155.sol \ No newline at end of file +truffle test \ + ./test/v2/TransferExecutor.test.js \ + ./test/contracts/v2/TransferExecutorTest.sol \ + ./test/contracts/v2/TestRoyaltiesRegistry.sol \ + ./test/contracts/tokens/TestERC20.sol \ + ./test/contracts/tokens/TestERC721.sol \ + ./test/contracts/tokens/TestERC721Dep.sol \ + ./test/contracts/tokens/TestERC1155.sol \ No newline at end of file diff --git a/exchange-v2/contracts/exchange/v2/RoyaltiesRegistry.sol b/exchange-v2/test/contracts/v2/TestRoyaltiesRegistry.sol similarity index 98% rename from exchange-v2/contracts/exchange/v2/RoyaltiesRegistry.sol rename to exchange-v2/test/contracts/v2/TestRoyaltiesRegistry.sol index 28ccbc757..a13df46ff 100644 --- a/exchange-v2/contracts/exchange/v2/RoyaltiesRegistry.sol +++ b/exchange-v2/test/contracts/v2/TestRoyaltiesRegistry.sol @@ -11,7 +11,7 @@ import "@rarible/royalties/contracts/impl/RoyaltiesV2Impl.sol"; import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721Upgradeable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; -contract RoyaltiesRegistry is IRoyaltiesProvider, OwnableUpgradeable { +contract TestRoyaltiesRegistry is IRoyaltiesProvider, OwnableUpgradeable { struct RoyaltiesSet { bool initialized; diff --git a/exchange-v2/test/v2/ExchangeV2.rarible.test.js b/exchange-v2/test/v2/ExchangeV2.rarible.test.js index 5c2d8d42a..c58d98ac9 100644 --- a/exchange-v2/test/v2/ExchangeV2.rarible.test.js +++ b/exchange-v2/test/v2/ExchangeV2.rarible.test.js @@ -10,7 +10,7 @@ const ERC20TransferProxy = artifacts.require("ERC20TransferProxy.sol"); const LibOrderTest = artifacts.require("LibOrderTest.sol"); const RaribleTransferManagerTest = artifacts.require("RaribleTransferManagerTest.sol"); const truffleAssert = require('truffle-assertions'); -const RoyaltiesRegistry = artifacts.require("RoyaltiesRegistry.sol"); +const TestRoyaltiesRegistry = artifacts.require("TestRoyaltiesRegistry.sol"); const TestERC721RoyaltyV1OwnUpgrd = artifacts.require("TestERC721WithRoyaltiesV1OwnableUpgradeable"); const { Order, Asset, sign } = require("../order"); @@ -42,7 +42,7 @@ contract("ExchangeV2, sellerFee + buyerFee = 6%,", accounts => { await transferProxy.__TransferProxy_init(); erc20TransferProxy = await ERC20TransferProxy.new(); await erc20TransferProxy.__ERC20TransferProxy_init(); - royaltiesRegistry = await RoyaltiesRegistry.new(); + royaltiesRegistry = await TestRoyaltiesRegistry.new(); testing = await deployProxy(ExchangeV2, [transferProxy.address, erc20TransferProxy.address, 300, 300, community, royaltiesRegistry.address], { initializer: "__ExchangeV2_init" }); await transferProxy.addOperator(testing.address); await erc20TransferProxy.addOperator(testing.address); diff --git a/exchange-v2/test/v2/RaribleManager.test.js b/exchange-v2/test/v2/RaribleManager.test.js index fb1f8a767..8c019249a 100644 --- a/exchange-v2/test/v2/RaribleManager.test.js +++ b/exchange-v2/test/v2/RaribleManager.test.js @@ -11,7 +11,7 @@ const ERC1155_V1 = artifacts.require("TestERC1155WithRoyaltiesV1.sol"); const ERC1155_V2 = artifacts.require("TestERC1155WithRoyaltiesV2.sol"); const ERC721_V1_Error = artifacts.require("TestERC721WithRoyaltiesV1_InterfaceError.sol"); const ERC1155_V2_Error = artifacts.require("TestERC1155WithRoyaltiesV2_InterfaceError.sol"); -const RoyaltiesRegistry = artifacts.require("RoyaltiesRegistry.sol"); +const TestRoyaltiesRegistry = artifacts.require("TestRoyaltiesRegistry.sol"); const { Order, Asset, sign } = require("../order"); const EIP712 = require("../EIP712"); @@ -52,7 +52,7 @@ contract("RaribleTransferManagerTest:doTransferTest()", accounts => { erc20TransferProxy = await ERC20TransferProxy.new(); await erc20TransferProxy.__ERC20TransferProxy_init(); testing = await RaribleTransferManagerTest.new(); - royaltiesRegistry = await RoyaltiesRegistry.new(); + royaltiesRegistry = await TestRoyaltiesRegistry.new(); await testing.__TransferManager_init(transferProxy.address, erc20TransferProxy.address, 300, 300, community, royaltiesRegistry.address); await transferProxy.addOperator(testing.address); await erc20TransferProxy.addOperator(testing.address);