-
Notifications
You must be signed in to change notification settings - Fork 283
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
Tests/gossip #515
base: develop
Are you sure you want to change the base?
Tests/gossip #515
Conversation
gossip/evmstore/store_test.go
Outdated
"testing" | ||
|
||
"github.com/ethereum/go-ethereum/core/types" | ||
"github.com/stretchr/testify/assert" |
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.
It will be better to use "github.com/stretchr/testify/require" instead, for uniformity purpose.
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.
Make sense, changed
gossip/evmstore/store_test.go
Outdated
store.SetTx(tx.Hash(), tx) | ||
|
||
txFromStore := store.GetTx(tx.Hash()) | ||
assert.Equal(t, tx.Data(), txFromStore.Data()) |
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.
How about comparing of the rest of tx's public fields?
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.
Good call, added
gossip/emitter/parents_test.go
Outdated
em.quorumIndexer = nil | ||
em.fcIndexer = ancestor.NewFCIndexer(newValidators, em.world.DagIndex(), em.config.Validator.ID) | ||
|
||
em.buildSearchStrategies(idx.Event(4)) |
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.
Check if the returned value is equal to expected.
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.
Done
gossip/emitter/parents_test.go
Outdated
}) | ||
|
||
t.Run("choose parent not selfParent", func(t *testing.T) { | ||
em.chooseParents(idx.Epoch(1), em.config.Validator.ID) |
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.
Check if the returned value is equal to expected.
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.
Done
Unit test to raise gossip test coverage