Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ To write to & read from the in-memory data store, use .save() and .load(). You c

**Matchstick error handling "gotcha's" -**

- Test assertions can still "pass" with a green checkmark... with broken logic in your code (without creating & asserting against a GraphQL entity, for example). To fix, write assertions that will fail first with an incorrect value --> then once your mocks & setup are correct, update your assert. value to pass to confirm your call handler is covered. You can also use logStore() to confirm your entity was created/modified successfuly - Type conversion is a MUST, especially when mocking the Solidity call inputValues. Matchstick won't always flag a type mismatch. Instead, the test might pass, or break with no verbose error message. You may want to set logging breakpoints throughout your test to see which are missed by the unit test breaking. Try logging your inputValues in your mapping file to confirm the type conversion was successful- if not, your log message will print but your val will be missing.
- Test assertions can still "pass" with a green checkmark... with broken logic in your code (without creating & asserting against a GraphQL entity, for example). To fix, write assertions that will fail first with an incorrect value --> then once your mocks & setup are correct, update your assert. value to pass to confirm your call handler is covered. You can also use logStore() to confirm your entity was created/modified successfully - Type conversion is a MUST, especially when mocking the Solidity call inputValues. Matchstick won't always flag a type mismatch. Instead, the test might pass, or break with no verbose error message. You may want to set logging breakpoints throughout your test to see which are missed by the unit test breaking. Try logging your inputValues in your mapping file to confirm the type conversion was successful- if not, your log message will print but your val will be missing.

## Errors not caught by Testing

Expand Down
4 changes: 2 additions & 2 deletions src/mapping-v3-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ function refreshProjectScript(
): void {
let scriptDetails = contract.try_projectScriptDetails(project.projectId);
if (scriptDetails.reverted) {
log.warning("Could not retrive script info for project {}", [project.id]);
log.warning("Could not retrieve script info for project {}", [project.id]);
return;
}

Expand Down Expand Up @@ -1346,7 +1346,7 @@ export function handleExternalAssetDependencyRemoved(
assetEntity.save();
}

// lastEntityIndex is previous external asset dependecy count - 1
// lastEntityIndex is previous external asset dependency count - 1
project.externalAssetDependencyCount = lastEntityIndex;
project.updatedAt = event.block.timestamp;
project.save();
Expand Down