Skip to content

Commit

Permalink
fix: failing AssetCreate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
capedcrusader21 committed Aug 28, 2024
1 parent aee0eae commit 9e4e17b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions packages/deploy/test/asset/assetCreateFixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const setupAssetCreateTests = deployments.createFixture(

const {
assetAdmin,
sandAdmin,
backendAuthWallet,
assetPauser,
treasury,
Expand Down Expand Up @@ -46,6 +47,9 @@ const setupAssetCreateTests = deployments.createFixture(
lazyMintingCatSeller
);

const OrderValidatorAsAdmin = OrderValidatorContract.connect(
await ethers.provider.getSigner(sandAdmin)
);
const CatalystContractAsAdmin = CatalystContract.connect(
await ethers.provider.getSigner(catalystMinter)
);
Expand Down Expand Up @@ -78,6 +82,13 @@ const setupAssetCreateTests = deployments.createFixture(
const createBatchLazyMintSignature = (data: LazyMintBatchData) =>
createMultipleLazyMintSignature(data, AssetCreateContract, network);

const ERC20_ROLE = await OrderValidatorContract.ERC20_ROLE();
await OrderValidatorAsAdmin.grantRole(
ERC20_ROLE,
await SandContract.getAddress()
);
await OrderValidatorAsAdmin.disableWhitelists();

return {
AssetContract,
AssetCreateContract,
Expand Down
6 changes: 5 additions & 1 deletion packages/deploy/utils/lazyMinting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type Order = {
makeAsset: Asset;
taker: string;
takeAsset: Asset;
makeRecipient: string;
salt: Numeric;
start: Numeric;
end: Numeric;
Expand Down Expand Up @@ -115,6 +116,7 @@ export async function signOrder(
{name: 'makeAsset', type: 'Asset'},
{name: 'taker', type: 'address'},
{name: 'takeAsset', type: 'Asset'},
{name: 'makeRecipient', type: 'address'},
{name: 'salt', type: 'uint256'},
{name: 'start', type: 'uint256'},
{name: 'end', type: 'uint256'},
Expand All @@ -131,13 +133,15 @@ export const OrderDefault = async (
takeAsset: Asset,
salt: Numeric,
start: Numeric,
end: Numeric
end: Numeric,
makeRecipient?: Address
): Promise<Order> => ({
maker: await maker.getAddress(),
makeAsset,
taker:
taker === ZeroAddress ? ZeroAddress : await (taker as Signer).getAddress(),
takeAsset,
makeRecipient: makeRecipient || (await maker.getAddress()), // Use makerAddress if makeRecipient is not provided
salt,
start,
end,
Expand Down

1 comment on commit 9e4e17b

@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

98.01%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
packages/asset/contracts
   Asset.sol94.70%89.58%96.67%98.15%117, 208, 310, 310–311, 77
   AssetCreate.sol90.36%80.39%95.65%97.58%114, 188–189, 270–271, 316, 392–393, 426, 480–481, 488–489, 496–497, 506, 512, 512–513, 513, 513–515
   AssetReveal.sol94.35%86.21%96.55%98.89%143, 147, 181, 376, 416, 424, 441, 75, 98
   AuthSuperValidator.sol92%87.50%100%90.91%66–67
   Catalyst.sol95.14%91.94%95.83%98.28%124, 126, 139, 151, 223, 79
packages/asset/contracts/interfaces
   IAsset.sol100%100%100%100%
   IAssetCreate.sol100%100%100%100%
   IAssetReveal.sol100%100%100%100%
   ICatalyst.sol100%100%100%100%
   IExchange.sol100%100%100%100%
   ITokenUtils.sol100%100%100%100%
packages/asset/contracts/libraries
   TokenIdUtils.sol100%100%100%100%
packages/marketplace/contracts
   Exchange.sol94.52%93.33%94.44%96%126, 194, 72
   ExchangeCore.sol98.85%96.67%100%100%85
   OrderValidator.sol96.83%92.86%100%100%110, 36
   RoyaltiesRegistry.sol96.32%88.89%100%98.78%194, 216–217, 263, 65
   TransferManager.sol94.86%84.85%100%99.23%150, 181, 191, 239, 379, 385, 400, 412–413, 424, 93
   Whitelist.sol75.81%60%85.71%82.14%104, 108–109, 122, 125, 141–142, 54, 66, 66–67, 71, 76
packages/marketplace/contracts/interfaces
   IOrderValidator.sol100%100%100%100%
   IRoyaltiesProvider.sol100%100%100%100%
   ITransferManager.sol100%100%100%100%
   IWhitelist.sol100%100%100%100%
packages/marketplace/contracts/libraries
   LibAsset.sol100%100%100%100%
   LibMath.sol100%100%100%100%
   LibOrder.sol100%100%100%100%

Please sign in to comment.