Skip to content
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

fail to pass some testcase with solana (1.17) and anchor(0.29.0 #26

Open
opcc22059 opened this issue Nov 6, 2024 · 0 comments
Open

Comments

@opcc22059
Copy link

opcc22059 commented Nov 6, 2024

Hi, we can not pass some test cases.

the anchor version we installed is v0.29.0, and the solana version we installed is 1.17.34.

we can not install solana 1.17.0 because version bellow v1.17.25 is not provided by solana official currently.

we also tried solana with version v1.17.25 but still fail on some test cases.

Could you please give us some help? Thanks a lot!

Following are test case errors when solana is v1.17.34 and v1.17.25

And Appendix shows the commands we adopted to install the dependencies

errors for solana v1.17.34

  deposit test
    ✔ deposit test, add the same liquidity and check the correctness of the values with and without transfer fees (12833ms)
    1) deposit test with 100% transferFeeConfig, reache maximum fee limit

  initialize test
    ✔ create pool without fee (3236ms)
    2) create pool with fee
    3) create pool with token2022 mint has transfer fee

  swap test
    ✔ swap base input without transfer fee (4088ms)
    ✔ swap base output without transfer fee (4081ms)
    ✔ swap base output with transfer fee (4084ms)

  withdraw test
    ✔ withdraw half of lp  (4090ms)
    ✔ withdraw all lp  (4097ms)


  7 passing (46s)
  3 failing

  1) deposit test
       deposit test with 100% transferFeeConfig, reache maximum fee limit:
     Error: AnchorError caused by account: token_0_mint. Error Code: ConstraintRaw. Error Number: 2003. Error Message: A raw constraint was violated.
      at Function.parse (node_modules/@coral-xyz/anchor/src/error.ts:167:14)
      at translateError (node_modules/@coral-xyz/anchor/src/error.ts:276:35)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:35:29)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  2) initialize test
       create pool with fee:
     Error: Raw transaction eoXP6dJJJyofkZVSw3AtfPXYUL6t2CbvGUNSo9dDSv9gEck3Zpd7pAEKPv6QofdboHVSARHHtkjnUx3s7jjh9dc failed ({"err":{"InstructionError":[0,{"Custom":6001}]}})
      at /home/ubuntu/git/raydium-cp-swap/tests/utils/web3.ts:53:11
      at Generator.next (<anonymous>)
      at fulfilled (tests/utils/web3.ts:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  3) initialize test
       create pool with token2022 mint has transfer fee:
     Error: Raw transaction 62jVTZvcToHdd3jVm9MtkbFVXS4jeMbPRqxoJfsCe6jscHQDvVNyTEseCB5mfuzSMTJyFdhFWf6nvfHanGNegnyz failed ({"err":{"InstructionError":[0,{"Custom":6001}]}})
      at /home/ubuntu/git/raydium-cp-swap/tests/utils/web3.ts:53:11
      at Generator.next (<anonymous>)
      at fulfilled (tests/utils/web3.ts:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)



error Command failed with exit code 3.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

errors for solana v1.17.25

deposit test
    ✔ deposit test, add the same liquidity and check the correctness of the values with and without transfer fees (10338ms)
    ✔ deposit test with 100% transferFeeConfig, reache maximum fee limit (3674ms)

  initialize test
    ✔ create pool without fee (3253ms)
    1) create pool with fee
    2) create pool with token2022 mint has transfer fee

  swap test
    3) swap base input without transfer fee
    4) swap base output without transfer fee
    ✔ swap base output with transfer fee (4054ms)

  withdraw test
    ✔ withdraw half of lp  (4086ms)
    ✔ withdraw all lp  (4094ms)


  6 passing (43s)
  4 failing

  1) initialize test
       create pool with fee:
     Error: Raw transaction 2BKKDyLCnhAHtkyN3HUf8wguvESFxU5SfeyAtC83WMPpiZdzpYsqTkAGpPjWUP6UDvsC6cG4qDaXwqE4wgDr2xyk failed ({"err":{"InstructionError":[0,{"Custom":6001}]}})
      at /home/ubuntu/git/raydium-cp-swap/tests/utils/web3.ts:53:11
      at Generator.next (<anonymous>)
      at fulfilled (tests/utils/web3.ts:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  2) initialize test
       create pool with token2022 mint has transfer fee:
     Error: Raw transaction 4kALGHfwGjNBKgygqkjkgxeoWfSa3SdecoNiRYfCHQ2TPWdouvvkMxjwRoDKFo14uUhfdSNGssiSuoZvzTyT3pLi failed ({"err":{"InstructionError":[0,{"Custom":6001}]}})
      at /home/ubuntu/git/raydium-cp-swap/tests/utils/web3.ts:53:11
      at Generator.next (<anonymous>)
      at fulfilled (tests/utils/web3.ts:5:58)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  3) swap test
       swap base input without transfer fee:
     Error: AnchorError thrown in programs/cp-swap/src/instructions/swap_base_input.rs:83. Error Code: NotApproved. Error Number: 6000. Error Message: Not approved.
      at Function.parse (node_modules/@coral-xyz/anchor/src/error.ts:151:14)
      at translateError (node_modules/@coral-xyz/anchor/src/error.ts:276:35)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:35:29)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)

  4) swap test
       swap base output without transfer fee:
     Error: AnchorError caused by account: token_0_mint. Error Code: ConstraintRaw. Error Number: 2003. Error Message: A raw constraint was violated.
      at Function.parse (node_modules/@coral-xyz/anchor/src/error.ts:167:14)
      at translateError (node_modules/@coral-xyz/anchor/src/error.ts:276:35)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:35:29)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)



error Command failed with exit code 4.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

appendix

environment:

ubuntu 22.04

installation:

rust
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
$ . "$HOME/.cargo/env"
$ rustc --version
rustc 1.82.0 (f6e511eec 2024-10-15)
solana
sh -c "$(curl -sSfL https://release.anza.xyz/${version}/install)"

## We have tried v1.17.25 and v1.17.34 both, we cannot get v1.17.0 because the minimum version provided by solana now is v1.17.25

anchor
$ cargo install --git https://github.com/coral-xyz/anchor avm --force
$ anchor install v0.29.0
$ anchor --version
anchor-cli 0.29.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant