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

Update web3 version #61

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Update web3 version #61

wants to merge 4 commits into from

Conversation

a0ngo
Copy link

@a0ngo a0ngo commented Aug 4, 2022

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.

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.
@@ -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"

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.
@a0ngo a0ngo requested a review from kyle-dydx August 17, 2022 09:21
@a0ngo
Copy link
Author

a0ngo commented Oct 6, 2022

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
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants