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

bug fix get transaction api route #1876

Merged
merged 5 commits into from Jun 5, 2020

Conversation

miiu96
Copy link
Contributor

@miiu96 miiu96 commented Jun 5, 2020

Fix panic bug when try to get a transaction which is in pool using api route /transaction/:txhash

Bug: In pool transactions are kept as objects ( Transaction, RewardTransaction, SmartContracResult, etc..) and when you try to get a transaction from pool there was a wrong cast to []byte which panics.

Fix: Removed the wrong cast and added a new function which do a cast to a specific transaction.

@miiu96 miiu96 self-assigned this Jun 5, 2020
@miiu96 miiu96 changed the title bug fix bug fix get transaction api route Jun 5, 2020
@miiu96 miiu96 changed the base branch from development to release-candidate June 5, 2020 11:15
@miiu96 miiu96 added the type:bug Something isn't working label Jun 5, 2020
Copy link
Contributor

@bogdan-rosianu bogdan-rosianu left a comment

Choose a reason for hiding this comment

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

good find and nice refactoring 👍

Copy link
Collaborator

@andreibancioiu andreibancioiu left a comment

Choose a reason for hiding this comment

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

Good find 🎉

@@ -500,17 +502,42 @@ func TestNode_GetTransaction_ShouldNotFindAndReturnUnknown(t *testing.T) {
assert.Error(t, err)
}

func getCacherHandler(find bool) func() dataRetriever.ShardedDataCacherNotifier {
func getCacherHandler(find bool, cacherType string) func() dataRetriever.ShardedDataCacherNotifier {
Copy link
Collaborator

Choose a reason for hiding this comment

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

You could have created separate functions to create the dummy pools (without the switch). But ok for now.

Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

System tests passed.

@LucianMincu LucianMincu merged commit 6757634 into release-candidate Jun 5, 2020
@LucianMincu LucianMincu deleted the fix-bug-get-transaction branch June 5, 2020 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants