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
Epoch service events #799
Epoch service events #799
Conversation
} | ||
|
||
// extract simple fields | ||
counter, ok := cdcEvent.Fields[0].(cadence.UInt64) |
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 be more maintainable and less error prone to have these indices defined as constants:
const (
counterFieldIndex int = iota
participantsIndex
// etc
)
Then we get to this function, we can have the indices replaced by predefined constants:
counter, ok := cdcEvent.Fields[counterFieldIndex].(cadence.UInt64)
return nil, invalidCadenceTypeError("cluster", cdcCluster, cadence.Struct{}) | ||
} | ||
|
||
expectedFields := 2 |
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.
Similar suggestion for these embedded values (i.e., constant aliasing)
Codecov Report
@@ Coverage Diff @@
## master #799 +/- ##
==========================================
+ Coverage 56.49% 56.56% +0.06%
==========================================
Files 427 429 +2
Lines 25133 25461 +328
==========================================
+ Hits 14199 14402 +203
- Misses 9013 9082 +69
- Partials 1921 1977 +56
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
As discussed with @jordanschalm - this is a cherry pick from epoch branch which contains expanding on service events which is useful for verification of them in upcoming PRs.
Epoch branch is a big changeset and this subset is self-contained so we agreed to extract it here.