-
Notifications
You must be signed in to change notification settings - Fork 11
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
refactor: break up transformer and rpc package logic into smaller func and add unit tests #1313
base: staging
Are you sure you want to change the base?
Conversation
…nto m/refactor-indexing-v2
…Values & TestCalculateTxFee methods
…nto m/refactor-indexing-v2
… calculateUncleReward & verifyName methods
…ly & getERC20ContractDecimals method
…nto m/refactor-indexing-v2
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.
There is a lot of good things in that pr but I'm wondering if some changes go maybe too far (too many little functions, too many tests that test not exported func without direct link to usage, ...) and will be a burden in the long run.
|
||
// TestGetMaxFeePerBlobGas tests the getMaxFeePerBlobGas function | ||
// which extracts the max fee per blob gas from a transaction | ||
func TestGetMaxFeePerBlobGas(t *testing.T) { |
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.
Do we really want to test each individual function like that ? Too much tests is like too much codes, harder to maintain, more complex and prone to brake.
I mean what this test is really testing ? Following this logic we could do a test for each field of a block. IMO it's better to create one test where we test each field all together.
Changes:
transformer.go
functions in the/executionlayer
package by breaking them into smaller, more readable functionserigon.go
andgeth.go
functions in the/rpc
package by splitting them into smaller functions and introducedutils.go
to share common functionality between themutils_test.go
anderigon_test.go
in the/rpc
packagetransformer_test.go
in the/executionlayer
package