1

I have a rust solana program code on beta.solpg.io.

After development, I am about to test my code but I don't know how to do it.

I copied deposit and withdraw program sample code on github, but I don't know how it works and tests.

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Commented Dec 28, 2023 at 18:16

2 Answers 2

1

You'd need to write tests yourself first in the anchor.test.ts file under tests folder: Screenshot

Then, you can either run test command in CLI or click on the " Test" button. In case you don't see the file there, just create a anchor.test.ts yourself and get started!

1
  • Thanks for your reply. It is so helpful but can you please let me know more in detail ? If possible, can you please share your sample code and how to use it ? Actually, I am newbie on blockchain. I don't know the way I can learn solana smart contract step by step. I prefer doc tutorials to video tutorial. If possible please let me know how to learn it in a short term. I have basic knowledge about JS,PHP,C# and Python. Thanks. I am waiting for your rely.
    – tonny
    Commented Dec 28, 2023 at 21:18
0

I don't think that answer alone will be enough. like that: const initialize = web3.Keypair.generate(); const user = web3.Keypair.generate(); How can I handle it? We need to think more deeply about it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.