You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this moment of writing this issue, the latest version of @solana/spl-token now is 0.4.9
What the new version of @solana/spl-token brings?
Its functionality can replace @project-serum/common and @project-serum/serum which haven't been updated for 4 years. in current code it uses chunky SPL token client boilerplate code to implement some functionalities now support by the latest version of @solana/spl-token. for instance:
The new version comes with new functionality for Token-2022. for example, in current code when it needs to use ASSOCIATED_TOKEN_PROGRAM_ID and TOKEN_2022_PROGRAM_ID , it has to copy and paste in many parts , which results in many code duplications. like here
It uses two functions addExtraAccountsToInstruction & addExtraAccountsToInstruction to generate an instruction for checked transfer with transfer hook. But in the new version of @solana/spl-token you can do it in only 1 function call createTransferCheckedWithTransferHookInstruction
In General
As these tests are used for developers to learn about anchor, it's better to provide examples of latest version and up-to-date usages. rather than show the users the usage of old versions (which containing many broken changes) of 4 years ago. Otherwise the user has to learn again what changes has been made in past 4 years, that might make the learning curve deeper.
I spent a week of my free time to address this upgrade. I will submit the PR and brief the changes I made in the PR soon.
The text was updated successfully, but these errors were encountered:
The issue
under
tests
folder, inpackage.json
file, you can find now it still using rather old version dependencies, which were published 4 years ago.At this moment of writing this issue, the latest version of
@solana/spl-token
now is0.4.9
What the new version of
@solana/spl-token
brings?Its functionality can replace
@project-serum/common
and@project-serum/serum
which haven't been updated for 4 years. in current code it uses chunky SPL token client boilerplate code to implement some functionalities now support by the latest version of @solana/spl-token. for instance:anchor/tests/spl/token-proxy/tests/token-proxy.js
Lines 254 to 296 in 6ff6655
The new version comes with new functionality for
Token-2022
. for example, in current code when it needs to useASSOCIATED_TOKEN_PROGRAM_ID
andTOKEN_2022_PROGRAM_ID
, it has to copy and paste in many parts , which results in many code duplications. like hereanchor/tests/misc/tests/misc/misc.ts
Lines 28 to 30 in 6ff6655
but in the new version, it can direclty import from the package like
another example
anchor/tests/spl/transfer-hook/tests/transfer-hook.ts
Lines 258 to 262 in 6ff6655
It uses two functions
addExtraAccountsToInstruction
&addExtraAccountsToInstruction
to generate an instruction for checked transfer with transfer hook. But in the new version of@solana/spl-token
you can do it in only 1 function callcreateTransferCheckedWithTransferHookInstruction
In General
As these tests are used for developers to learn about
anchor
, it's better to provide examples of latest version and up-to-date usages. rather than show the users the usage of old versions (which containing many broken changes) of 4 years ago. Otherwise the user has to learn again what changes has been made in past 4 years, that might make the learning curve deeper.I spent a week of my free time to address this upgrade. I will submit the PR and brief the changes I made in the PR soon.
The text was updated successfully, but these errors were encountered: