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

WebSocketProvider's getTransactionReceipt throws "unknown error" for pending tx #813

Closed
danielattilasimon opened this issue May 3, 2020 · 4 comments
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.

Comments

@danielattilasimon
Copy link

I believe other Providers return null in this case.

I think the error originates from this part:

if (result.result) {
request.callback(null, result.result);
} else {
if (result.error) {
const error: any = new Error(result.error.message || "unknown error");
defineReadOnly(error, "code", result.error.code || null);
defineReadOnly(error, "response", data);
request.callback(error, undefined);
} else {
request.callback(new Error("unknown error"), undefined);
}
}

When a receipt is not found, result.result will be null.

@ricmoo ricmoo added bug Verified to be an issue. on-deck This Enhancement or Bug is currently being worked on. labels May 3, 2020
@ricmoo
Copy link
Member

ricmoo commented May 3, 2020

I think you are absolutely correct. I will look into this first thing in the morning and get a fix out.

@danielattilasimon
Copy link
Author

Awesome, thanks so much!

@ricmoo
Copy link
Member

ricmoo commented May 7, 2020

This should be fixed in 5.0.0-beta.185. Let me know if you still have any problems. :)

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels May 7, 2020
@ricmoo
Copy link
Member

ricmoo commented May 8, 2020

Closing this now. Please re-open if you have any issues.

Thanks! :)

@ricmoo ricmoo closed this as completed May 8, 2020
michaeltout pushed a commit to michaeltout/ethers.js that referenced this issue Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified to be an issue. fixed/complete This Bug is fixed or Enhancement is complete and published.
Projects
None yet
Development

No branches or pull requests

2 participants