-
Notifications
You must be signed in to change notification settings - Fork 242
[fetchreferences2] Adding event enrichment for all event types #623
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
[fetchreferences2] Adding event enrichment for all event types #623
Conversation
Signed-off-by: David Echelberger <eberger727@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #623 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 311 311
Lines 18784 18845 +61
=========================================
+ Hits 18784 18845 +61
Continue to review full report at Codecov.
|
| return namespace, nil | ||
| } | ||
|
|
||
| func (s *SQLCommon) GetNamespaceByID(ctx context.Context, id *fftypes.UUID) (ns *fftypes.Namespace, err error) { |
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.
Could we follow the pattern here and remove a lot of the code/test duplication?
firefly/internal/database/sqlcommon/datatype_sql.go
Lines 160 to 166 in 1c0672c
| func (s *SQLCommon) GetDatatypeByID(ctx context.Context, id *fftypes.UUID) (message *fftypes.Datatype, err error) { | |
| return s.getDatatypeEq(ctx, sq.Eq{"id": id}, id.String()) | |
| } | |
| func (s *SQLCommon) GetDatatypeByName(ctx context.Context, ns, name, version string) (message *fftypes.Datatype, err error) { | |
| return s.getDatatypeEq(ctx, sq.Eq{"namespace": ns, "name": name, "version": version}, fmt.Sprintf("%s:%s", ns, name)) | |
| } |
peterbroadhurst
left a comment
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.
Looks great!
One request to remove a bit of duplication before this goes in @eberger727
Signed-off-by: David Echelberger <eberger727@gmail.com>
| Transaction *Transaction `json:"transaction,omitempty"` | ||
| BlockchainEvent *BlockchainEvent `json:"blockchainevent,omitempty"` | ||
| BlockchainEvent *BlockchainEvent `json:"blockchainevent,omitempty"` | ||
| ContractAPI *ContractAPI `json:"contractAPI,omitempty"` |
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.
Discussed that the API here is /api/v1/namespaces/{ns}/apis, but felt it was clearer to include contractAPI rather than just api here
| Datatype *Datatype `json:"datatype,omitempty"` | ||
| Identity *Identity `json:"identity,omitempty"` | ||
| Message *Message `json:"message,omitempty"` | ||
| NamespaceDetails *Namespace `json:"namespaceDetails,omitempty"` |
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.
Note this cannot follow the pattern and just be namespace, because that is already just the string name of the namespace.
GET /events?fetchreferencesnow returns enriched events for all event types: