Skip to content

Commit

Permalink
Add blackist tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wojciech-turek committed Aug 16, 2023
1 parent fd2398c commit c88275a
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions packages/deploy/test/asset/Asset.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ const setupTest = deployments.createFixture(
const MockERC1155MarketPlace4 = await deployments.get(
'MockERC1155MarketPlace4'
);

const deployerSigner = await ethers.getSigner(deployer);

const tx1 = await OperatorFilterRegistryContract.connect(
deployerSigner
).register(filterOperatorSubscription);

await tx1.wait();

await network.provider.send('hardhat_setBalance', [
'0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6',
'0xDE0B6B3A7640000',
Expand All @@ -65,18 +69,22 @@ const setupTest = deployments.createFixture(
await OperatorFilterRegistryContract.connect(signer).codeHashOf(
MockERC1155MarketPlace2.address
);

const subscriptionSigner = await ethers.getSigner(
filterOperatorSubscription
);
const tx2 = await OperatorFilterRegistryContract.connect(
signer
subscriptionSigner
).updateOperators(
'0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6',
filterOperatorSubscription,
[MockERC1155MarketPlace1.address, MockERC1155MarketPlace2.address],
true
);
await tx2.wait();
const tx3 = await OperatorFilterRegistryContract.connect(
signer
subscriptionSigner
).updateCodeHashes(
'0x3cc6CddA760b79bAfa08dF41ECFA224f810dCeB6',
filterOperatorSubscription,
[MockMarketPlace1CodeHash, MockMarketPlace2CodeHash],
true
);
Expand Down Expand Up @@ -205,7 +213,7 @@ describe('Asset', function () {
)
).to.be.equal(filterOperatorSubscription);
});
it('catalyst contract has correct market places black listed', async function () {
it('asset contract has correct market places black listed', async function () {
const {
OperatorFilterRegistryContract,
AssetContract,
Expand All @@ -218,25 +226,29 @@ describe('Asset', function () {
await OperatorFilterRegistryContract.isOperatorFiltered(
AssetContract.address,
MockERC1155MarketPlace1.address
)
),
'MarketPlace1 should be filtered'
).to.be.equal(true);
expect(
await OperatorFilterRegistryContract.isOperatorFiltered(
AssetContract.address,
MockERC1155MarketPlace2.address
)
),
'MarketPlace2 should be filtered'
).to.be.equal(true);
expect(
await OperatorFilterRegistryContract.isOperatorFiltered(
AssetContract.address,
MockERC1155MarketPlace3.address
)
),
'MarketPlace3 should not be filtered'
).to.be.equal(false);
expect(
await OperatorFilterRegistryContract.isOperatorFiltered(
AssetContract.address,
MockERC1155MarketPlace4.address
)
),
'MarketPlace4 should not be filtered'
).to.be.equal(false);
});
});
Expand Down

1 comment on commit c88275a

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage for this commit

97.23%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/asset/contracts
   Asset.sol94.53%89.58%96.43%98.08%108, 193, 298, 298–299, 70
   AssetCreate.sol93.42%75%100%100%125, 127, 160, 266, 64
   AssetReveal.sol96.60%87.50%100%100%138, 170, 365, 406, 68
   AuthSuperValidator.sol100%100%100%100%
   Catalyst.sol94.81%91.94%95.24%98.08%133, 135, 148, 160, 231, 88
packages/asset/contracts/interfaces
   IAsset.sol100%100%100%100%
   IAssetCreate.sol100%100%100%100%
   IAssetReveal.sol100%100%100%100%
   ICatalyst.sol100%100%100%100%
   ITokenUtils.sol100%100%100%100%
packages/asset/contracts/libraries
   TokenIdUtils.sol100%100%100%100%
packages/dependency-metatx/contracts
   ERC2771Handler.sol100%100%100%100%
   ERC2771HandlerAbstract.sol100%100%100%100%
   ERC2771HandlerUpgradeable.sol95.45%83.33%100%100%43
packages/dependency-metatx/contracts/test
   ERC2771HandlerTest.sol100%100%100%100%
   ERC2771HandlerUpgradeableTest.sol100%100%100%100%
   MockTrustedForwarder.sol0%0%0%0%15, 18–19, 19, 19–20
packages/dependency-operator-filter/contracts
   OperatorFiltererUpgradeable.sol88.64%85%100%90%14, 48–49, 58–59
   OperatorFilterSubscription.sol60%50%100%50%18–19
packages/dependency-operator-filter/contracts/interfaces
   IOperatorFilterRegistry.sol100%100%100%100%
packages/dependency-royalty-management/contracts
   MultiRoyaltyDistributor.sol88.71%62.50%100%97.44%101, 108, 41, 41, 41, 41, 70
   RoyaltyDistributor.sol90.91%50%100%100%44
   RoyaltyManager.sol96%86.36%100%100%100, 44, 94
   RoyaltySplitter.sol90.91%75%92.31%95.89%107, 147, 167, 176, 191, 228, 56, 63, 78
packages/dependency-royalty-management/contracts/interfaces
   IERC20Approve.sol100%100%100%100%
   IMultiRoyaltyDistributor.sol100%100%100%100%
   IMultiRoyaltyRecipients.sol100%100%100%100%
   IRoyaltyManager.sol100%100%100%100%
   IRoyaltyUGC.sol100%100%100%100%

Please sign in to comment.