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

chore(lib/trie): lib/trie/recorder sub-package #2082

Merged

Conversation

qdm12
Copy link
Contributor

@qdm12 qdm12 commented Nov 30, 2021

Changes

  • See title
  • Add tests for the recorder

Tests

go test -race ./lib/trie/...

Issues

Primary Reviewer

@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #2082 (ba6cc40) into qdm12-trie-node-subpkg-base (91ed716) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##           qdm12-trie-node-subpkg-base    #2082      +/-   ##
===============================================================
- Coverage                        60.12%   60.09%   -0.04%     
===============================================================
  Files                              221      221              
  Lines                            27284    27278       -6     
===============================================================
- Hits                             16405    16392      -13     
- Misses                            8989     9000      +11     
+ Partials                          1890     1886       -4     
Flag Coverage Δ
unit-tests 60.09% <100.00%> (-0.04%) ⬇️

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

Impacted Files Coverage Δ
lib/trie/lookup.go 73.91% <100.00%> (ø)
lib/trie/proof.go 68.75% <100.00%> (-0.64%) ⬇️
lib/trie/record/recorder.go 100.00% <100.00%> (ø)
dot/peerset/peerset.go 52.39% <0.00%> (-1.87%) ⬇️
dot/peerset/peerstate.go 75.00% <0.00%> (-1.34%) ⬇️
lib/runtime/wasmer/imports.go 48.79% <0.00%> (-0.06%) ⬇️
dot/core/service.go 55.44% <0.00%> (+0.77%) ⬆️

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 91ed716...ba6cc40. Read the comment docs.

lib/trie/record/recorder.go Outdated Show resolved Hide resolved
@EclesioMeloJunior EclesioMeloJunior merged commit 0d8335b into qdm12-trie-node-subpkg-base Nov 30, 2021
@EclesioMeloJunior EclesioMeloJunior deleted the qdm12-trie-recorder-subpkg branch November 30, 2021 19:53
@qdm12
Copy link
Contributor Author

qdm12 commented Dec 1, 2021

@EclesioMeloJunior careful when merging PRs even when approved, this was pointing to #2077 and I originally wanted to rebase it on development once the base branch #2077 would be merged, to limit deltas.

@EclesioMeloJunior
Copy link
Member

@qdm12 sorry about that, I thought everything was fine, I will be careful next times! Thanks for warning!

qdm12 added a commit that referenced this pull request Dec 2, 2021
* `lib/trie/recorder` subpackage

* return an error on a call to Next() with no node

* remove recorder `IsEmpty` method

* Recorder `GetNodes()`
qdm12 added a commit that referenced this pull request Dec 7, 2021
* `lib/trie/recorder` subpackage

* return an error on a call to Next() with no node

* remove recorder `IsEmpty` method

* Recorder `GetNodes()`
qdm12 added a commit that referenced this pull request Dec 9, 2021
* `lib/trie/recorder` subpackage

* return an error on a call to Next() with no node

* remove recorder `IsEmpty` method

* Recorder `GetNodes()`
qdm12 added a commit that referenced this pull request Dec 13, 2021
* `lib/trie/recorder` subpackage

* return an error on a call to Next() with no node

* remove recorder `IsEmpty` method

* Recorder `GetNodes()`
qdm12 added a commit that referenced this pull request Dec 16, 2021
…age (#2077)

* Chore(packages): move node interface, leaf & branch implementations, encoding and decoding functions in `internal/trie/node`
* Chore(packages): create `internal/trie/recorder` subpackage (#2082) 
* Chore(packages): create `internal/trie/pools` subpackage
* Chore(packages): create `internal/trie/codec` subpackage
* Chore(tests): add tests with near full coverage
* Chore(errors): improve error wrapping on trie node implementations and encoding/decoding
* Optimization: use `sync.Pool` for header byte reading
* Optimization: encode headers directly to buffer
* Code addition: `GetValue() []byte` method for node interface
* Code addition: `GetKey() []byte` method for node interface
* Chore(comments): add and clarify existing comments
* Chore(api): unexport node implementation fields: `Generation`, `Dirty`, `Encoding` and `Hash`
* Minor change: trie `string()` method does not cache encoding in nodes. This is only used for debugging.

Co-authored-by: Kishan Sagathiya <kishansagathiya@gmail.com>
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.

3 participants