Open csjcode opened 5 months ago
Thank you very much for the report. I can reproduce it. Ill fix it asap in the guide and playground. In the meantime please use the working version here: https://github.com/solana-developers/program-examples/tree/main/tokens/token-2022/transfer-hook/anchor/TransferHookTransferCost
Thanks, much appreciated, I will try that!
Problem
The wSOL token extension transfer hook tutorial has a couple issues I believe, I'm getting some errors including from the "final" version listed....
Tutorial: https://solana.com/developers/guides/token-extensions/transfer-hook#run-test-file
I tested this both with (1) the "final" solpg code link and (2) code in the walkthrough (there are slight differences in each)
Linked as "final program" in the tutorial: https://beta.solpg.io/github.com/solana-developers/anchor-transfer-hook/tree/main
Console Output:
Transaction Signature: 28b3AhseYv68pKguMo5MxQEdjqM5SbuhZ7oZ15N99yw4WuKZTZwrs6qEDYjkr7uk5ED1GnLpxRbqrmi4cG483o8Q ✔ Create Mint Account with Transfer Hook Extension (796ms) test Transaction Signature: 5dWnbeDfnF1rGrKgx7CYtv9TudXWo8W9cVPAKVNmxNcuLZeTk7HJW5vqcZ4RYVA9FGvSRiRBdn1r1cAWrMgwBSte ✔ Create Token Accounts and Mint Tokens (830ms) Transaction Signature: Hog1VA4S3oKtGBaaD2AJpZm15PYAq3AGYBTjygsphNBrutgdPUj4obeQpfMQPjDTEhNMreVZWMZEzzvaVsgShB7 ✔ Create ExtraAccountMetaList Account (860ms) 1) Transfer Hook with Extra Account Meta 3 passing (4s) 1 failing 1) transfer-hook Transfer Hook with Extra Account Meta: TokenTransferHookInvalidSeed
The walkthrough code for the tests has some minor errors in the ExtraAccountMetaList function (ie. bigIntAmount left out, naming different). Also, for example one uses a transferInstructionWithHelper function, while the other does not have that.
Also noticed some of the imports are different.
Not sure if the test error is related to all that... but just fyi.
Proposed Solution
I'm just hoping for any insight or if the code can be updated to make the test successful. I just encountereed it, so I am not sure of any solution yet myself.