Skip to content

Commit 483c564

Browse files
committed
run pnpm fix
1 parent 4306620 commit 483c564

File tree

3 files changed

+33
-60
lines changed

3 files changed

+33
-60
lines changed

tokens/pda-mint-authority/steel/prepare.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
#!/usr/bin/env zx
22

3-
import { mkdir, rm } from "node:fs/promises";
4-
import { join } from "node:path";
5-
import { $ } from "zx";
3+
import { mkdir, rm } from 'node:fs/promises';
4+
import { join } from 'node:path';
5+
import { $ } from 'zx';
66

77
const programs = [
88
{
9-
id: "metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s",
10-
name: "token_metadata.so",
9+
id: 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s',
10+
name: 'token_metadata.so',
1111
},
1212
];
1313

14-
const outputDir = "tests/fixtures";
14+
const outputDir = 'tests/fixtures';
1515
const overwrite = true;
1616

1717
try {

tokens/pda-mint-authority/steel/tests/instructions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BN } from "bn.js";
1+
import { BN } from 'bn.js';
22

33
class Assignable {
44
constructor(properties) {
@@ -84,7 +84,7 @@ export class MintToArgs {
8484
offset += 1;
8585

8686
// Write quantity as u64 LE (8 bytes)
87-
this.quantity.toBuffer("le", 8).copy(buffer, offset);
87+
this.quantity.toBuffer('le', 8).copy(buffer, offset);
8888

8989
return buffer;
9090
}

tokens/pda-mint-authority/steel/tests/tests.ts

Lines changed: 25 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,29 @@
1-
import { Buffer } from "node:buffer";
2-
import { describe, test } from "node:test";
3-
import { PROGRAM_ID as TOKEN_METADATA_PROGRAM_ID } from "@metaplex-foundation/mpl-token-metadata";
4-
import {
5-
ASSOCIATED_TOKEN_PROGRAM_ID,
6-
TOKEN_PROGRAM_ID,
7-
getAssociatedTokenAddressSync,
8-
} from "@solana/spl-token";
9-
import {
10-
Keypair,
11-
PublicKey,
12-
SYSVAR_RENT_PUBKEY,
13-
SystemProgram,
14-
Transaction,
15-
TransactionInstruction,
16-
} from "@solana/web3.js";
17-
import { start } from "solana-bankrun";
18-
import { InitArgs, CreateTokenArgs, MintToArgs } from "./instructions";
19-
20-
describe("PDA MINT AUTHORITY", async () => {
21-
const PROGRAM_ID = new PublicKey(
22-
"z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35",
23-
);
1+
import { Buffer } from 'node:buffer';
2+
import { describe, test } from 'node:test';
3+
import { PROGRAM_ID as TOKEN_METADATA_PROGRAM_ID } from '@metaplex-foundation/mpl-token-metadata';
4+
import { ASSOCIATED_TOKEN_PROGRAM_ID, TOKEN_PROGRAM_ID, getAssociatedTokenAddressSync } from '@solana/spl-token';
5+
import { Keypair, PublicKey, SYSVAR_RENT_PUBKEY, SystemProgram, Transaction, TransactionInstruction } from '@solana/web3.js';
6+
import { start } from 'solana-bankrun';
7+
import { CreateTokenArgs, InitArgs, MintToArgs } from './instructions';
8+
9+
describe('PDA MINT AUTHORITY', async () => {
10+
const PROGRAM_ID = new PublicKey('z7msBPQHDJjTvdQRoEcKyENgXDhSRYeHieN1ZMTqo35');
2411
const context = await start(
2512
[
26-
{ name: "pda_mint_authority_program", programId: PROGRAM_ID },
27-
{ name: "token_metadata", programId: TOKEN_METADATA_PROGRAM_ID },
13+
{ name: 'pda_mint_authority_program', programId: PROGRAM_ID },
14+
{ name: 'token_metadata', programId: TOKEN_METADATA_PROGRAM_ID },
2815
],
2916
[],
3017
);
3118
const client = context.banksClient;
3219
const payer = context.payer;
3320

3421
const mintKeypair: Keypair = Keypair.generate();
35-
const mintAuthorityPublicKey = PublicKey.findProgramAddressSync(
36-
[Buffer.from("mint_authority")],
37-
PROGRAM_ID,
38-
)[0];
22+
const mintAuthorityPublicKey = PublicKey.findProgramAddressSync([Buffer.from('mint_authority')], PROGRAM_ID)[0];
3923

40-
test("Init mind authority PDA!", async () => {
24+
test('Init mint authority PDA!', async () => {
4125
const metadataPDA = PublicKey.findProgramAddressSync(
42-
[
43-
Buffer.from("metadata"),
44-
TOKEN_METADATA_PROGRAM_ID.toBuffer(),
45-
mintKeypair.publicKey.toBuffer(),
46-
],
26+
[Buffer.from('metadata'), TOKEN_METADATA_PROGRAM_ID.toBuffer(), mintKeypair.publicKey.toBuffer()],
4727
TOKEN_METADATA_PROGRAM_ID,
4828
)[0];
4929

@@ -66,26 +46,22 @@ describe("PDA MINT AUTHORITY", async () => {
6646

6747
await client.processTransaction(tx);
6848

69-
console.log("Success!");
49+
console.log('Success!');
7050
console.log(` Mint Address: ${mintKeypair.publicKey}`);
7151
});
7252

73-
test("Create a SPL Token with PDA!", async () => {
53+
test('Create a SPL Token with PDA!', async () => {
7454
const metadataPDA = PublicKey.findProgramAddressSync(
75-
[
76-
Buffer.from("metadata"),
77-
TOKEN_METADATA_PROGRAM_ID.toBuffer(),
78-
mintKeypair.publicKey.toBuffer(),
79-
],
55+
[Buffer.from('metadata'), TOKEN_METADATA_PROGRAM_ID.toBuffer(), mintKeypair.publicKey.toBuffer()],
8056
TOKEN_METADATA_PROGRAM_ID,
8157
)[0];
8258

8359
// SPL Token default = 9 decimals
8460
//
8561
const createArgs = new CreateTokenArgs(
86-
"Solana Gold",
87-
"GOLDSOL",
88-
"https://raw.githubusercontent.com/solana-developers/program-examples/new-examples/tokens/tokens/.assets/spl-token.json",
62+
'Solana Gold',
63+
'GOLDSOL',
64+
'https://raw.githubusercontent.com/solana-developers/program-examples/new-examples/tokens/tokens/.assets/spl-token.json',
8965
);
9066

9167
const createTokenIx = new TransactionInstruction({
@@ -118,15 +94,12 @@ describe("PDA MINT AUTHORITY", async () => {
11894

11995
await client.processTransaction(tx);
12096

121-
console.log("Success!");
97+
console.log('Success!');
12298
console.log(` Mint Address: ${mintKeypair.publicKey}`);
12399
});
124100

125-
test("Mint some tokens to your wallet with PDA!", async () => {
126-
const associatedTokenAccountAddress = getAssociatedTokenAddressSync(
127-
mintKeypair.publicKey,
128-
payer.publicKey,
129-
);
101+
test('Mint some tokens to your wallet with PDA!', async () => {
102+
const associatedTokenAccountAddress = getAssociatedTokenAddressSync(mintKeypair.publicKey, payer.publicKey);
130103

131104
const mintArgs = new MintToArgs(100);
132105

@@ -163,7 +136,7 @@ describe("PDA MINT AUTHORITY", async () => {
163136

164137
await client.processTransaction(tx);
165138

166-
console.log("Success!");
139+
console.log('Success!');
167140
console.log(` ATA Address: ${associatedTokenAccountAddress}`);
168141
});
169142
});

0 commit comments

Comments
 (0)