-
Notifications
You must be signed in to change notification settings - Fork 10
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
Bugfix invalid block number or hash #313
Changes from all commits
35e7f63
f4d8a60
c47eae8
5705366
e64df96
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,9 +1,12 @@ | ||||||
package api | ||||||
|
||||||
import ( | ||||||
"errors" | ||||||
"math/big" | ||||||
|
||||||
"github.com/onflow/go-ethereum/core/types" | ||||||
|
||||||
errs "github.com/onflow/flow-evm-gateway/api/errors" | ||||||
) | ||||||
|
||||||
const blockGasLimit uint64 = 15_000_000 | ||||||
|
@@ -44,5 +47,10 @@ func encodeTxFromArgs(args TransactionArgs) ([]byte, error) { | |||||
}, | ||||||
) | ||||||
|
||||||
return tx.MarshalBinary() | ||||||
enc, err := tx.MarshalBinary() | ||||||
if err != nil { | ||||||
return nil, errors.Join(err, errs.ErrInvalid) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct error wrapping syntax. The - return nil, errors.Join(err, errs.ErrInvalid)
+ return nil, fmt.Errorf("%w: %v", errs.ErrInvalid, err) Committable suggestion
Suggested change
|
||||||
} | ||||||
|
||||||
return enc, nil | ||||||
} |
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.
Refactor repeated error handling in
GetLogs
.The
handleError
function is used multiple times in the same method. Consider refactoring to reduce redundancy and improve code clarity.Also applies to: 565-565, 570-570