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

maintenance: cleanup TODOs, add issues numbers to remaining TODOs #1876

Merged
merged 26 commits into from
Oct 15, 2021

Conversation

noot
Copy link
Contributor

@noot noot commented Oct 8, 2021

Changes

  • cleanup TODOs, delete ones that reference closed issues or are no longer issues
  • implement some smaller/simple TODOs
  • add issue numbers to all remaining TODOs

Tests

go test ./... -short

Issues

Primary Reviewer

@@ -132,3 +132,19 @@ func NewTestGenesisWithTrieAndHeader(t *testing.T) (*Genesis, *trie.Trie, *types
require.NoError(t, err)
return gen, genTrie, genesisHeader
}

// NewDevGenesisWithTrieAndHeader generates test dev genesis, genesis trie and genesis header
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we merge code of NewTestGenesisWithTrieAndHeader and NewDevGenesisWithTrieAndHeader?
The code is similar except for the file name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


return headers
}

func newTestHandler(t *testing.T, withBABE, withGrandpa bool) *Handler { //nolint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

withBABE and withGrandpa are not used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

// AddBlocksToState adds blocks to a BlockState up to depth, with random branches
func AddBlocksToState(t *testing.T, blockState *BlockState, depth int) ([]*types.Header, []*types.Header) {
// AddBlocksToState adds `depth` number of blocks to the BlockState, optionally with random branches
func AddBlocksToState(t *testing.T, blockState *BlockState, depth int, withBranches bool) ([]*types.Header, []*types.Header) {
previousHash := blockState.BestBlockHash()

branches := []testBranch{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

	var (
		currentChain, branchChains []*types.Header
		branches []testBranch
	)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@@ -134,7 +134,7 @@ func (s *testStreamHandler) writeToStream(stream libp2pnetwork.Stream, msg Messa

func (s *testStreamHandler) readStream(stream libp2pnetwork.Stream, peer peer.ID, decoder messageDecoder, handler messageHandler) {
var (
maxMessageSize uint64 = maxBlockResponseSize // TODO: determine actual max message size
maxMessageSize uint64 = maxBlockResponseSize
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

msgBytes := make([]byte, maxBlockResponseSize)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

return nil
}

for _, key := range keys {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*res = make([]interface{}, 0, len(keys))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment on lines 76 to 80
err = decoder.Decode(&e.Version)
if err != nil {
return err
}
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return decoder.Decode(&e.Version)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@noot noot requested a review from arijitAD October 13, 2021 09:18
@@ -661,7 +661,7 @@ func ext_crypto_sr25519_verify_version_1(context unsafe.Pointer, sig C.int32_t,

if ok, err := pub.VerifyDeprecated(message, signature); err != nil || !ok {
logger.Debug("[ext_crypto_sr25519_verify_version_1] failed to validate signature", "error", err)
// TODO: fix this, fails at block 3876
// Tthis fails at block 3876, which seems to be expected, based on discussions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Tthis fails at block 3876, which seems to be expected, based on discussions
// This fails at block 3876, which seems to be expected, based on discussions

@codecov
Copy link

codecov bot commented Oct 15, 2021

Codecov Report

Merging #1876 (11316c7) into development (bf903f2) will decrease coverage by 0.12%.
The diff coverage is 61.32%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #1876      +/-   ##
===============================================
- Coverage        59.72%   59.60%   -0.13%     
===============================================
  Files              187      187              
  Lines            19185    19110      -75     
===============================================
- Hits             11458    11390      -68     
- Misses            5819     5825       +6     
+ Partials          1908     1895      -13     
Flag Coverage Δ
unit-tests 59.60% <61.32%> (-0.13%) ⬇️

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

Impacted Files Coverage Δ
cmd/gossamer/config.go 72.50% <ø> (-0.19%) ⬇️
cmd/gossamer/export.go 84.37% <ø> (-0.48%) ⬇️
cmd/gossamer/main.go 15.05% <ø> (ø)
cmd/gossamer/utils.go 70.17% <ø> (ø)
dot/config.go 26.63% <ø> (ø)
dot/digest/digest.go 66.32% <ø> (ø)
dot/network/block_announce.go 68.75% <ø> (ø)
dot/network/message.go 75.00% <ø> (ø)
dot/network/notifications.go 74.05% <ø> (ø)
dot/network/sync.go 6.38% <0.00%> (ø)
... and 70 more

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 7a5deec...11316c7. Read the comment docs.

@noot noot merged commit fab5a6e into development Oct 15, 2021
@noot noot deleted the noot/todo-cleanup branch October 15, 2021 14:36
@github-actions
Copy link

github-actions bot commented Dec 3, 2021

🎉 This PR is included in version 0.6.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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.

Triage TODO Comments from Code
3 participants