Skip to content

Commit

Permalink
run pnpm format:fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Perelyn-sama committed Nov 6, 2024
1 parent 5ebf711 commit 3a36ab8
Showing 1 changed file with 11 additions and 25 deletions.
36 changes: 11 additions & 25 deletions basics/hello-solana/steel/tests/hello-solana.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import { describe, test } from "node:test";
import {
PublicKey,
Transaction,
TransactionInstruction,
} from "@solana/web3.js";
import { assert } from "chai";
import { start } from "solana-bankrun";
import { describe, test } from 'node:test';
import { PublicKey, Transaction, TransactionInstruction } from '@solana/web3.js';
import { assert } from 'chai';
import { start } from 'solana-bankrun';

describe("hello-solana", async () => {
describe('hello-solana', async () => {
// load program in solana-bankrun
const PROGRAM_ID = new PublicKey(
"z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35",
);
const context = await start(
[{ name: "hello_solana_program", programId: PROGRAM_ID }],
[],
);
const PROGRAM_ID = new PublicKey('z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35');
const context = await start([{ name: 'hello_solana_program', programId: PROGRAM_ID }], []);
const client = context.banksClient;
const payer = context.payer;

test("Say hello!", async () => {
test('Say hello!', async () => {
const blockhash = context.lastBlockhash;
// We set up our instruction first.
const ix = new TransactionInstruction({
Expand All @@ -36,14 +27,9 @@ describe("hello-solana", async () => {
const transaction = await client.processTransaction(tx);

assert(transaction.logMessages[0].startsWith(`Program ${PROGRAM_ID}`));
assert(transaction.logMessages[1] === "Program log: Hello, Solana!");
assert(
transaction.logMessages[2] ===
`Program log: Our program's Program ID: ${PROGRAM_ID}`,
);
assert(
transaction.logMessages[3].startsWith(`Program ${PROGRAM_ID} consumed`),
);
assert(transaction.logMessages[1] === 'Program log: Hello, Solana!');
assert(transaction.logMessages[2] === `Program log: Our program's Program ID: ${PROGRAM_ID}`);
assert(transaction.logMessages[3].startsWith(`Program ${PROGRAM_ID} consumed`));
assert(transaction.logMessages[4] === `Program ${PROGRAM_ID} success`);
assert(transaction.logMessages.length === 5);
});
Expand Down

0 comments on commit 3a36ab8

Please sign in to comment.