-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ts: instanceof PublicKey not working #1101
Labels
Comments
Maybe |
there is no command I also tried doing sth like |
Maybe old node version? $ npm why @solana/web3.js
@solana/[email protected]
node_modules/@solana/web3.js
@solana/web3.js@"^1.17.0" from @project-serum/[email protected]
node_modules/@project-serum/anchor
@project-serum/anchor@"=0.18.0" from the root project
peer @solana/web3.js@"^1.2.0" from @project-serum/[email protected]
node_modules/@project-serum/borsh
@project-serum/borsh@"^0.2.2" from @project-serum/[email protected]
node_modules/@project-serum/anchor
@project-serum/anchor@"=0.18.0" from the root project
@project-serum/borsh@"^0.2.2" from @project-serum/[email protected]
node_modules/@project-serum/serum/node_modules/@project-serum/anchor
@project-serum/anchor@"^0.11.1" from @project-serum/[email protected]
node_modules/@project-serum/serum
dev @project-serum/serum@"^0.13.41" from the root project
@solana/web3.js@"^1.21.0" from @project-serum/[email protected]
node_modules/@project-serum/serum
dev @project-serum/serum@"^0.13.41" from the root project
@solana/web3.js@"^1.17.0" from @project-serum/[email protected]
node_modules/@project-serum/serum/node_modules/@project-serum/anchor
@project-serum/anchor@"^0.11.1" from @project-serum/[email protected]
node_modules/@project-serum/serum
dev @project-serum/serum@"^0.13.41" from the root project
@solana/web3.js@"^1.21.0" from @solana/[email protected]
node_modules/@solana/spl-token
dev @solana/spl-token@"^0.1.8" from the root project
@solana/spl-token@"^0.1.6" from @project-serum/[email protected]
node_modules/@project-serum/serum
dev @project-serum/serum@"^0.13.41" from the root project
$ node --version
v17.2.0
$ npm --version
8.1.4 |
just updated to lts, same issue still occurs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I discovered this while working on #1098
The PR adds an error that is thrown when
translateAddress
receives an object that is not a string or a public key so that callers of the function can handle it.I initially tried using
address instanceof PublicKey
for this but it made some tests fail by throwing the error so I thought these tests are passing something else intotranslateAddress
and the test is written wrong. But it isnt. I logged the prototype chain of what is actually passed in in the test and it is a PublicKey.e.g.
but for some reason
instanceof PublicKey
failsThe text was updated successfully, but these errors were encountered: