solana-playground / solana-playground

Quickly develop, deploy and test Solana programs from browsers
https://beta.solpg.io
Apache License 2.0
399 stars 135 forks source link

Seeds derived differently in playground vs local #216

Open Woody4618 opened 1 month ago

Woody4618 commented 1 month ago

When running the tests locally in this example the tests are all green.

https://github.com/solana-developers/program-examples/tree/main/tokens/token-2022/transfer-hook/anchor/TransferHookTransferCost

When running them in playground though: https://beta.solpg.io/https://github.com/solana-developers/program-examples/tree/main/tokens/token-2022/transfer-hook/anchor/TransferHookTransferCost

There is an error TokenTransferHookInvalidSeed.

image

My Local versions: solana-cargo-build-sbf 1.18.4 platform-tools v1.39 rustc 1.72.0 solana-cli 1.18.4 (src:356c6a38; feat:3352961542, client:SolanaLabs) anchor-cli 0.29.0

Deps: [dependencies] anchor-lang = "0.29.0" anchor-spl = "0.29.0" solana-program = "1.17.13" spl-transfer-hook-interface = "0.4.1" spl-tlv-account-resolution = "0.5.0"

acheroncrypto commented 1 month ago

Maybe it's because we're on @solana/spl-token 0.3.10?

https://github.com/solana-playground/solana-playground/blob/de4d6ab2bcb3096d041e95a6a9414b5d5665bad7/client/yarn.lock#L2768-L2769

Woody4618 commented 1 month ago

Oh yes that is indeed the problem. Could you update to
"@solana/spl-token": "^0.4.0" ? Or even better 0.4.1?

acheroncrypto commented 1 month ago

Updated to @solana/spl-token 0.4.3 (latest) in https://github.com/solana-playground/solana-playground/commit/911a1ea2fdc09d15b2bb9db123cae8972849116f but there is a new error now which is most likely caused by the crate version this time.