-
Notifications
You must be signed in to change notification settings - Fork 20
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
Update web3 version #61
Open
a0ngo
wants to merge
4
commits into
dydxprotocol:master
Choose a base branch
from
a0ngo:patch-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update to resolve web3-core-requestmanager issue reported in web3/web3.js#3721 Assume a provider is passed to DydxClient, where the request function uses the 'this' keyword (for example to ensure initialization of the provider, perhaps fetching some data). When calling functions, such as: `client.eth.exchange.deposit(....)` The flow will eventually reach: 'RequestManager.send' In this, when calling the provider.request, we do not bind the provider, thus the value of 'this' is undefined, and any call to 'this' will result in an error due to undefined value. The fix will add the '.bind(this.provider)' which is currently missing, and make the 'this' value to be defined to the provider initially provided to the client.
kyle-dydx
suggested changes
Aug 16, 2022
@@ -32,7 +32,7 @@ | |||
"bignumber.js": "^9.0.1", | |||
"lodash": "^4.17.20", | |||
"starkware-crypto": "^1.9.7", | |||
"web3": "1.3.0" | |||
"web3": "1.3.1" |
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.
Please update the package-lock.json as well
Update to resolve web3-core-requestmanager issue reported in web3/web3.js#3721 Assume a provider is passed to DydxClient, where the request function uses the 'this' keyword (for example to ensure initialization of the provider, perhaps fetching some data). When calling functions, such as: `client.eth.exchange.deposit(....)` The flow will eventually reach: 'RequestManager.send' In this, when calling the provider.request, we do not bind the provider, thus the value of 'this' is undefined, and any call to 'this' will result in an error due to undefined value. The fix will add the '.bind(this.provider)' which is currently missing, and make the 'this' value to be defined to the provider initially provided to the client.
Hi @kyle-dydx any news about this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update to resolve web3-core-requestmanager issue reported in web3/web3.js#3721
Assume a provider is passed to DydxClient, where the request function uses the
this
keyword (for example to ensure initialization of the provider, perhaps fetching some data).When calling functions, such as:
client.eth.exchange.deposit(....)
The flow will eventually reach:
RequestManager.send
In this, when calling the provider.request, we do not bind the provider, thus the value of
this
is undefined, and any call to 'this' will result in an error due to undefined value.The fix will add the
.bind(this.provider)
which is currently missing, and make thethis
value to be defined to the provider initially provided to the client.