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

Added basics/processing-instructions/poseidon #285

Merged
Prev Previous commit
Next Next commit
fix: fixed the poseidon code
  • Loading branch information
ritikbhatt20 committed Oct 28, 2024
commit 93d0c38c6e9e4c102637ef3a82e45b430b1a7131
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
// import * as anchor from '@coral-xyz/anchor';
// import { Program } from '@coral-xyz/anchor';
// import { Keypair, PublicKey, SystemProgram } from '@solana/web3.js';
// import { assert } from 'chai';
// import { ProcessingInstructionsProgram } from '../target/types/processing_instructions_program';
import * as anchor from '@coral-xyz/anchor';
import { Program } from '@coral-xyz/anchor';
import { Keypair, PublicKey, SystemProgram } from '@solana/web3.js';
import { assert } from 'chai';
import { ProcessingInstructionsProgram } from '../target/types/processing_instructions_program';

// describe('processing_instructions_program', () => {
// // Configure the client to use the local cluster.
// const provider = anchor.AnchorProvider.env();
// anchor.setProvider(provider);
// const program = anchor.workspace.ProcessingInstructionsProgram as Program<ProcessingInstructionsProgram>;
// const payer = provider.wallet as anchor.Wallet;
describe('processing_instructions_program', () => {
// Configure the client to use the local cluster.
const provider = anchor.AnchorProvider.env();
anchor.setProvider(provider);
const program = anchor.workspace.ProcessingInstructionsProgram as Program<ProcessingInstructionsProgram>;
const payer = provider.wallet as anchor.Wallet;

// it('Tests the go_to_park function', async () => {
it('Tests the go_to_park function', async () => {
// Define the test parameters
const height = 6;
const name = 'Alice';

// // Define the test parameters
// const height = 6;
// const name = "Alice";
// Call the go_to_park function in the Solana program
const tx = await program.methods
.goToPark(height, name)
.accounts({
user: payer.publicKey,
})
.signers([payer.payer])
.rpc();

// // Call the go_to_park function in the Solana program
// const tx = await program.methods
// .goToPark(height, name)
// .accounts({
// user: payer.publicKey,
// })
// .signers([payer.payer])
// .rpc();
console.log('Your transaction signature', tx);

// console.log('Your transaction signature', tx);

// // Assertions can be made here based on expected behavior
// // Since we are using msg! for console messages, we don't have a direct way to capture these outputs in tests
// // However, we can still verify the transaction was successful
// assert.isNotNull(tx, 'Transaction should be successful');
// });
// });
// Assertions can be made here based on expected behavior
// Since we are using msg! for console messages, we don't have a direct way to capture these outputs in tests
// However, we can still verify the transaction was successful
assert.isNotNull(tx, 'Transaction should be successful');
});
});