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

chain: refactor transaction tests #1748

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

najeal
Copy link
Contributor

@najeal najeal commented Nov 7, 2024

Closes #1702 and refactors transaction tests to reduce testing logic to the minimum.
Tests were previously doing the same initialization. It was verbose. It has been moved in the setup of a test suite.

Copy link
Collaborator

@aaronbuchwald aaronbuchwald left a comment

Choose a reason for hiding this comment

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

Nice! Thanks for refactoring this to better share setup code.

Left one comment to use a setup helper function rather than use the testify Suite library

func (*action2) GetTypeID() uint8 {
return 222
func TestTransactionTestSuite(t *testing.T) {
suite.Run(t, new(TransactionTestSuite))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure testify suite adds much value to the tests beyond what we can do with a single helper function at the start of each test and would prefer not to introduce it here as the only test where we start using this tool.

Could we instead share test setup code via a single setup helper function that returns the fields that have currently been added to TransactionTestSuite ?

@najeal
Copy link
Contributor Author

najeal commented Nov 20, 2024

Changes have been applied 👍

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.

Complete Transaction Marshal/Unmarshal test
2 participants