-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: As a user, I want to have an example schema checker module #317
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #317 +/- ##
==========================================
+ Coverage 91.55% 91.66% +0.11%
==========================================
Files 13 14 +1
Lines 225 228 +3
Branches 53 54 +1
==========================================
+ Hits 206 209 +3
Misses 10 10
Partials 9 9
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Would it be better to have a hardcoded schema id here? This module is really an example to make it clear to other developers how you would check a schema, but maybe this could be clearer. What do you think? What about this: function run(
AttestationPayload memory attestationPayload,
bytes memory /*validationPayload*/,
address /*txSender*/,
uint256 /*value*/
) public view override {
if (keccak256(attestationPayload.schemaId) != keccak256(abi.encode("HARDCODED_SCHEMA_ID"))) {
revert InvalidSchemaId();
}
abi.decode(attestationPayload.attestationData, (address, bytes32, uint64));
} If the payload adheres to the Schema, this will pass, if not, it will revert. Does that make sense? |
I think that's ok for me. New update soon |
@orbmis Updated code, please review again. |
What does this PR do?
Related ticket
Fixes #267
Type of change
Check list