Skip to content

Commit

Permalink
refactor(*): replace RoyaltiesRegistry.sol from exchange-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
SKonstantinS committed Apr 8, 2021
1 parent cf73bb8 commit 487d838
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions exchange-v2/migrations/2_initial_ExchangeV2.js
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions exchange-v2/test-exchangev2-rarible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions exchange-v2/test-rarible-transfer-manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
9 changes: 8 additions & 1 deletion exchange-v2/test-transfer-executor.sh
Original file line number Diff line number Diff line change
@@ -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
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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions exchange-v2/test/v2/ExchangeV2.rarible.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions exchange-v2/test/v2/RaribleManager.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 487d838

Please sign in to comment.