Skip to content

Commit

Permalink
fix: fixed and removed test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh Sharma committed Sep 7, 2023
1 parent c1decd9 commit 9032009
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 63 deletions.
31 changes: 0 additions & 31 deletions packages/asset/test/AssetRoyalty.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -828,37 +828,6 @@ describe('Asset Royalties', function () {
});
});

it('Can view all the royalty recipient of each asset', async function () {
const {
Asset,
seller,
commonRoyaltyReceiver,
creator,
deployer,
assetAsMinter,
} = await assetRoyaltyDistribution();

const id = generateAssetId(creator.address, 1);
await assetAsMinter.mint(seller.address, id, 1, '0x');
const id2 = generateAssetId(deployer.address, 1);
await assetAsMinter.mint(seller.address, id2, 1, '0x01');
const tokenRoyalties = await Asset.getTokenRoyalties();
expect(tokenRoyalties[0].tokenId).to.be.equal(id);
expect(tokenRoyalties[0].recipients[0].recipient).to.be.equal(
creator.address
);
expect(tokenRoyalties[0].recipients[1].recipient).to.be.equal(
commonRoyaltyReceiver.address
);
expect(tokenRoyalties[1].tokenId).to.be.equal(id2);
expect(tokenRoyalties[1].recipients[0].recipient).to.be.equal(
deployer.address
);
expect(tokenRoyalties[1].recipients[1].recipient).to.be.equal(
commonRoyaltyReceiver.address
);
});

describe('Roles on Asset and Manager contract', function () {
it('creator could change the recipient for his splitter', async function () {
const {seller, RoyaltyManagerContract, creator, assetAsMinter} =
Expand Down
2 changes: 1 addition & 1 deletion packages/asset/test/utils/interfaceIds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const ERC1155MetadataURIInterfaceId = '0x0e89341c';
export const AccessControlInterfaceId = '0x7965db0b';
export const ERC2981InterfaceId = '0x2a55205a';
export const RoyaltyUGCInterfaceId = '0xa30b4db9';
export const RoyaltyMultiDistributorInterfaceId = '0x667873ce';
export const RoyaltyMultiDistributorInterfaceId = '0xf1e82fd0';
export const RoyaltyMultiRecipientsInterfaceId = '0xfd90e897';
Original file line number Diff line number Diff line change
Expand Up @@ -1814,26 +1814,6 @@ describe('Royalty', function () {
);
}
});
it('should return contract royalty BPS when getTokenRoyalties is called', async function () {
const {
seller,
ERC1155,
deployer,
royaltyReceiver,
RoyaltyManagerContract,
} = await royaltyDistribution();
await ERC1155.connect(deployer).mint(
seller.address,
1,
1,
royaltyReceiver.address,
'0x'
);
const tokenRoyalties = await ERC1155.getTokenRoyalties();
expect(tokenRoyalties[0].royaltyBPS).to.be.equal(
await RoyaltyManagerContract.getContractRoyalty(ERC1155.address)
);
});
});

describe('Input validation', function () {
Expand Down Expand Up @@ -2223,16 +2203,5 @@ describe('Royalty', function () {
commonRoyaltyReceiver.address
);
});
it('should return the tokens for which the royalties is set', async function () {
const {ERC1155, seller, royaltyReceiver} = await royaltyDistribution();
await ERC1155.connect(seller).mint(
seller.address,
1,
1,
royaltyReceiver.address,
'0x'
);
expect((await ERC1155.getTokenRoyalties()).length).to.be.equals(1);
});
});
});

1 comment on commit 9032009

@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

96.23%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/asset/contracts
   Asset.sol94.53%89.58%96.43%98.08%103, 188, 293, 293–294, 65
   AssetCreate.sol94.51%83.33%100%100%130, 132, 165, 281, 68
   AssetReveal.sol94.35%86.21%96.55%98.89%143, 147, 181, 376, 416, 424, 441, 75, 98
   AuthSuperValidator.sol100%100%100%100%
   Catalyst.sol94.81%91.94%95.24%98.08%125, 127, 140, 152, 223, 80
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.sol82.35%85%71.43%83.33%17, 51–52, 61–62, 71, 87
   OperatorFilterSubscription.sol60%50%100%50%19–20
packages/dependency-operator-filter/contracts/interfaces
   IOperatorFilterRegistry.sol100%100%100%100%
packages/dependency-royalty-management/contracts
   MultiRoyaltyDistributor.sol84.13%66.67%88.89%91.67%137, 40, 40, 40, 40, 58–59, 90, 97
   RoyaltyDistributor.sol76.92%50%75%85.71%45, 51
   RoyaltyManager.sol96.10%87.50%100%100%41, 91, 97
   RoyaltySplitter.sol92%75%91.67%97.06%111, 151, 180, 208, 59, 66, 76
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.