Upgrade @solana/spl-token to "0.4.9"#3447
Closed
yanCode wants to merge 13 commits intosolana-foundation:masterfrom
Closed
Upgrade @solana/spl-token to "0.4.9"#3447yanCode wants to merge 13 commits intosolana-foundation:masterfrom
yanCode wants to merge 13 commits intosolana-foundation:masterfrom
Conversation
|
@yanCode is attempting to deploy a commit to the coral-xyz Team on Vercel. A member of the Team first needs to authorize it. |
Collaborator
|
Going to close this as stale for now. |
This file contains hidden or 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
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.
This PR is created to fix #3446
all the tests in git action workflow are passed: the running result based latest code can be seen in my folked project of
anchorhttps://github.com/yanCode/anchor/actions/runs/12459231512What has been done:
Apart from the fixes described in the issue below refactory is made.
The deprecated
findProgramAddressmethod is replaced withfindProgramAddressSyncin the code affected by this PR. but there are still many other parts code containingfindProgramAddressin the whole project , including the core packagets/packages/anchor, which i think we might need to add an interfaceidlAddressSyncto deprecated the sync one.https://github.com/coral-xyz/anchor/blob/master/ts/packages/anchor/src/idl.ts#L275-L278
I will track & fix them after this PR is resolved.
Replaced the lamports unit from
10000000000to10 * LAMPORTS_PER_SOL, to make it a little bit better human readble.As required by latest version of
@solana/spl-token,typescriptas a dependency of it, is also required to upgrade to version 5, that's why I upgraded"typescript": "^5.7.2". alsotsconfig.jsonin the sub projects is simplified to extend from a parenttsconfig.jsonlocated intests/to avoid violatingDon't Repeat Yourselfrule.Another improvement when creating many
mintaccounts together, I usedPromise.allto sumbit them to the chain concurrently. Because solana blockchain can support concurrent execution of transactions on batch. (This is one of the reasons why solana is faster).After calling the instruction handler, it needs to pass in the accounts used in this intruction. There are methods inlcuding
accountsPartialandaccounts. If you check the doc, it saysaccountmethod only accepts accounts that cannot be resolved. but in current logic, the account parameters of many parts include some resolvable accounts likeSystemProgram.programIdandPDA. after upgrading to typescript5,npx tsc --noEmitcommand from the workflow can detect and complain about this kind of issue. so I repaced it withaccountsPartialwhich is more inclusive thanaccountsmethod when any resolvable accounts are in the account parameter.What hasn't been done:
tests/auction-house, current logic is based on an old version of"@metaplex/js": "^4.4.1", to upgrade@solana/spl-token, it also should be upgraded. to avoid the scope of this PR is too big. I keep this project using the old version of dependencies intests/auction-house/package.json.I take a note here, I will track and fix it after this PR is resolved.
In
tests/ido-pool, it usesetTimeoutto stop the execution of logic to ensure previous transaction is done. this can waste much more time than necessary, which breaches the fact: solana is faster. Actually, javascript/typescript is full async and event-driven. so it only need to async await the execution of the transction, with thecommitmentlevel to beconfirmed.The projects are execulded from github workflow is not changed and tested.