Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion traits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,17 @@ export const extractProjectTraitImplementations = (simnet: Simnet) => {
const projectTraitImplementations = allProjectContracts.reduce<
Record<string, ImplementedTraitType[]>
>((acc, contractId) => {
const ast = simnet.getContractAST(contractId);
// Some deployed contracts (notably remote `requirements` contracts) have

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important note to avoid confusion;

Remote doesn't rely on requirements at all.
It simply fetch whatever data your request from the Node RPC enpoints.

requirements are still being used for local development

// no introspectable AST in the simnet, so `getContractAST` throws. Such a
// contract cannot implement a project-local trait, so skip it instead of
// aborting the whole run.
let ast;
try {
ast = simnet.getContractAST(contractId);
}
catch (e) {
return acc;
}
const implementedTraits = ast.implemented_traits as ImplementedTraitType[];
if (implementedTraits.length > 0) {
acc[contractId] = implementedTraits;
Expand Down
Loading