-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
lib/src/protocol/models/message.dart
Outdated
// TODO: how to initialize properly? | ||
await Validator.initialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would like a better solution for initializing Validator
... any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You beat me to it, I was just about to suggest possibly using a singleton with a static constructor. Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
- name: Init Hermit | ||
uses: cashapp/activate-hermit@v1 | ||
with: | ||
cache: true | ||
|
||
- name: Install Dependencies | ||
run: just get | ||
|
||
- name: Run Static Analysis | ||
run: just analyze | ||
|
||
- name: Run Tests | ||
run: just test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!
final jsonResource = jsonDecode(payload) as Map<String, dynamic>?; | ||
if (jsonResource == null) { | ||
throw Exception('payload is not a valid JSON object'); | ||
} | ||
Validator.validate(jsonResource, 'resource'); | ||
|
||
final jsonResourceData = jsonResource['data']; | ||
final resourceMetadata = jsonResource['metadata'] as ResourceMetadata?; | ||
if (resourceMetadata == null) { | ||
throw Exception('metadata property is required'); | ||
} | ||
final resourceKind = resourceMetadata.kind.name; | ||
Validator.validate(jsonResourceData, resourceKind); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic seems duplicated, would it be better to put it in a class that can be parsed with data
and metadata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make sure to cover this in #6!
Summary
closes #2
parse()
tbdex
submodule (inspired by tbdex-js)verifyOfferingRequirements()
inrfq.dart
(except verifying the claims)also adds ci