Skip to content

Commit

Permalink
Fix compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
immrsd committed Dec 24, 2024
1 parent 4d5a3d5 commit 2112bbf
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions packages/core-cairo/src/generate/sources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,24 @@ function generateContractSubset(subset: Subset, kind?: Kind): GeneratedContract[
return contracts;
} else {
const getParents = (c: GeneratedContract) => c.contract.components.map(p => p.path);
function filterByUpgradeableSetTo(isUpgradeable: boolean) {
return (c: GeneratedContract) => {
switch (c.options.kind) {
case 'Vesting':
return isUpgradeable === false;
case 'Account':
case 'ERC20':
case 'ERC721':
case 'ERC1155':
case 'Governor':
case 'Custom':
return c.options.upgradeable === isUpgradeable;
}
}
}
return [
...findCover(contracts.filter(c => c.options.upgradeable === undefined), getParents),
...findCover(contracts.filter(c => c.options.upgradeable === true), getParents),
...findCover(contracts.filter(c => c.options.upgradeable === false), getParents),
...findCover(contracts.filter(filterByUpgradeableSetTo(true)), getParents),
...findCover(contracts.filter(filterByUpgradeableSetTo(false)), getParents),
];
}
}
Expand Down

0 comments on commit 2112bbf

Please sign in to comment.