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
graphql: return correct logs for tx #25612
Changes from 2 commits
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 |
---|---|---|
|
@@ -478,8 +478,11 @@ func (t *Transaction) getLogs(ctx context.Context) (*[]*Log, error) { | |
if err != nil { | ||
return nil, err | ||
} | ||
ret := make([]*Log, 0, len(logs)) | ||
ret := make([]*Log, 0) | ||
for _, log := range logs { | ||
if uint64(log.TxIndex) != t.index { | ||
continue | ||
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.
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. Also, it's kind of weird to use a filter here. We could just call 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. Hmm, just realized that the filter is used here exactly because 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. I kind of like the simplicity even tho it's slightly less fast, if you don't have a strong feeling about it. 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. Fix tested working on my personal node. 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. I'm slightly in favor of @fjl's suggestion. |
||
} | ||
ret = append(ret, &Log{ | ||
r: t.r, | ||
transaction: 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.