Skip to content
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

Merged
merged 3 commits into from Jun 18, 2021
Merged

Epoch service events #799

merged 3 commits into from Jun 18, 2021

Conversation

m4ksio
Copy link
Contributor

@m4ksio m4ksio commented Jun 8, 2021

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.

}

// extract simple fields
counter, ok := cdcEvent.Fields[0].(cadence.UInt64)
Copy link
Contributor

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
Copy link
Contributor

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-commenter
Copy link

Codecov Report

Merging #799 (5fa293a) into master (0fc3314) will increase coverage by 0.06%.
The diff coverage is 62.31%.

Impacted file tree graph

@@            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     
Flag Coverage Δ
unittests 56.56% <62.31%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
engine/execution/ingestion/engine.go 51.80% <0.00%> (ø)
model/flow/epoch.go 28.57% <ø> (ø)
model/flow/identifier.go 75.00% <0.00%> (-5.00%) ⬇️
model/flow/role.go 89.36% <0.00%> (-1.95%) ⬇️
model/convert/service_event.go 48.69% <48.69%> (ø)
model/convert/fixtures.go 100.00% <100.00%> (ø)
module/mempool/epochs/transactions.go 94.73% <0.00%> (-5.27%) ⬇️
cmd/util/ledger/migrations/storage_v4.go 41.56% <0.00%> (-0.61%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0fc3314...5fa293a. Read the comment docs.

@m4ksio m4ksio merged commit 774a8ac into master Jun 18, 2021
@m4ksio m4ksio deleted the m4ksio/epoch-service-events branch June 18, 2021 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants