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

Issue Running Initial Tests #25

Open
BravoNatalie opened this issue Nov 1, 2024 · 4 comments
Open

Issue Running Initial Tests #25

BravoNatalie opened this issue Nov 1, 2024 · 4 comments

Comments

@BravoNatalie
Copy link

BravoNatalie commented Nov 1, 2024

I’m trying to run the tests as outlined in the README, but I keep getting errors in the output. I’m new to the Solana ecosystem, so any guidance would be greatly appreciated!

1) initialize test
       create pool without fee:
     Error: Raw transaction 5Yed69n3JQZWwiXgxPx21TsHVdq9RcqqGAgwJq3SnFmVizXjH6bZoJRkbSeUetkRuEyhQnyp4Epfvo9xgXCcV7Wg failed ({"err":{"InstructionError":[0,"ProgramFailedToComplete"]}})
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:383:11)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:160:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:29:16)

  2) initialize test
       create pool with fee:
     Error: Raw transaction 5yZnNqtJDo9Dg7Wx2JMRsiurt4KJ6t9wC5FXrwKQrjeQEa31u6qRYcSDFphqW4UPdMPhspLuJxvcJvn71hChCEYG failed ({"err":{"InstructionError":[0,{"Custom":6001}]}})
      at /Users/bravo/GitHub/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 2AeW4oG1t5j1JVaa4ZY239eA5uji1unUVUym8T9KaocpxECDxzrEZSPNPnaHHNFzpUDFhYmpt1CPJPXeeYoyYfQU failed ({"err":{"InstructionError":[0,{"Custom":6001}]}})
      at /Users/bravo/GitHub/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)

  4) deposit test
       deposit test, add the same liquidity and check the correctness of the values with and without transfer fees:
     Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
  "Program log: Instruction: InitializeAccount3",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4214 of 152137 compute units",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20389 of 168029 compute units",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
  "Program 11111111111111111111111111111111 invoke [2]",
  "Program 11111111111111111111111111111111 success",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C consumed 90046 of 200000 compute units",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C failed: Access violation in unknown section at address 0x10008 of size 8"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:6043:13)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:5999:20)
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:370:21)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:160:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:29:16)

  5) deposit test
       deposit test with 100% transferFeeConfig, reache maximum fee limit:
     Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
  "Program log: Instruction: InitializeAccount3",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4214 of 146137 compute units",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 23389 of 165029 compute units",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
  "Program 11111111111111111111111111111111 invoke [2]",
  "Program 11111111111111111111111111111111 success",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C consumed 95916 of 200000 compute units",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C failed: Access violation in unknown section at address 0x10008 of size 8"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:6043:13)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:5999:20)
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:370:21)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:160:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:29:16)

  6) swap test
       swap base input without transfer fee:
     Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
  "Program log: Instruction: InitializeAccount3",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4214 of 153637 compute units",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20389 of 169529 compute units",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
  "Program 11111111111111111111111111111111 invoke [2]",
  "Program 11111111111111111111111111111111 success",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C consumed 86903 of 200000 compute units",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C failed: Access violation in unknown section at address 0x10008 of size 8"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:6043:13)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:5999:20)
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:370:21)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:160:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:29:16)

  7) swap test
       swap base output without transfer fee:
     Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
  "Program log: Instruction: InitializeAccount3",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4214 of 153637 compute units",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 20389 of 169529 compute units",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
  "Program 11111111111111111111111111111111 invoke [2]",
  "Program 11111111111111111111111111111111 success",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C consumed 68478 of 200000 compute units",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C failed: Access violation in unknown section at address 0x10008 of size 8"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:6043:13)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:5999:20)
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:370:21)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:160:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:29:16)

  8) swap test
       swap base output with 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)

  9) withdraw test
       withdraw half of lp :
     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)

  10) withdraw test
       withdraw all lp :
     Error: Simulation failed. 
Message: Transaction simulation failed: Error processing Instruction 0: Program failed to complete. 
Logs: 
[
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
  "Program log: Instruction: InitializeAccount3",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4214 of 144637 compute units",
  "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 23389 of 163529 compute units",
  "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
  "Program 11111111111111111111111111111111 invoke [2]",
  "Program 11111111111111111111111111111111 success",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C consumed 94338 of 200000 compute units",
  "Program CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C failed: Access violation in unknown section at address 0x10008 of size 8"
]. 
Catch the `SendTransactionError` and call `getLogs()` on it for full details.
      at Connection.sendEncodedTransaction (node_modules/@solana/web3.js/src/connection.ts:6043:13)
      at processTicksAndRejections (node:internal/process/task_queues:95:5)
      at Connection.sendRawTransaction (node_modules/@solana/web3.js/src/connection.ts:5999:20)
      at sendAndConfirmRawTransaction (node_modules/@coral-xyz/anchor/src/provider.ts:370:21)
      at AnchorProvider.sendAndConfirm (node_modules/@coral-xyz/anchor/src/provider.ts:160:14)
      at MethodsBuilder.rpc [as _rpcFn] (node_modules/@coral-xyz/anchor/src/program/namespace/rpc.ts:29:16)

@obstoody
Copy link

obstoody commented Nov 1, 2024

Please refer this link

Please confirm you are using anchor 0.29 and solana<1.18.0 versions to run the tests.

@BravoNatalie
Copy link
Author

BravoNatalie commented Nov 1, 2024

@obstoody Yes, I'm using the correct versions

anchor_version = "0.29.0"
solana_version = "1.17.0"

@obstoody
Copy link

obstoody commented Nov 6, 2024

You are running test code on which network?
If you are running on your local, you have to setup all the accounts you are using in test codes.

@BravoNatalie
Copy link
Author

I'm running locally. What do you mean I have to set up all accounts? Could you provide a step-by-step process?

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

2 participants