-
Notifications
You must be signed in to change notification settings - Fork 43
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 anchor to 0.20 #91
Conversation
966a030
to
9bd3341
Compare
@@ -26,7 +26,7 @@ | |||
}, | |||
"dependencies": { | |||
"@chainlink/gauntlet-core": "0.0.7", | |||
"@project-serum/anchor": "^0.18.0", | |||
"@project-serum/anchor": "^0.20.0", |
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.
This probably has some breaking changes. Can you open an story just to update this on gauntlet?
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.
I've opened a GH Issue:
Please just append the Gauntlet changes to this PR...
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.
I think it's mostly coral-xyz/anchor#1108 where the wallet is now only conditionally included
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.
The browser detection is flawed too coral-xyz/anchor#1233
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.
Seems like this is what is happening, but i'm not sure how to solve it as the proposed solution doesn't quite work 🤔
https://stackoverflow.com/a/63639280
Update:
Seems like it's importing it as a existing object not a class...so there's no access to set the key
Fix: import using node syntax rather than TS import syntax
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.
These fixes seem to get it to work. Tested it with a deploy:token
command. Tested with local env ✅
@@ -5,7 +5,7 @@ import { TransactionResponse } from '../types' | |||
import { Idl, Program, Provider, Wallet } from '@project-serum/anchor' | |||
|
|||
export default abstract class SolanaCommand extends WriteCommand<TransactionResponse> { | |||
wallet: Wallet | |||
wallet: typeof Wallet |
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.
Fix:
packages/gauntlet-solana/src/commands/internal/solana.ts:8:11 - error TS2749: 'Wallet' refers to a value, but is being used as a type here. Did you mean 'typeof Wallet'?
8 wallet: Wallet
~~~~~~
import { Provider } from '@project-serum/anchor' | ||
import { Connection, Keypair } from '@solana/web3.js' | ||
import SolanaCommand from './internal/solana' | ||
const { Wallet } = require('@project-serum/anchor') // module exported dynamically from anchor |
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.
Fix:
packages/gauntlet-solana/src/commands/middlewares.ts:28:18 - error TS2351: This expression is not constructable.
Type 'NodeWallet' has no construct signatures.
28 c.wallet = new Wallet(Keypair.fromSecretKey(Uint8Array.from(JSON.parse(rawPK))))
~~~~~~
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.
LGTM!
No description provided.