Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
DogukanGun committed Nov 25, 2024
1 parent e92006f commit 61fe4f0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
22 changes: 10 additions & 12 deletions tokens/transfer-tokens/poseidon/tests/transfer_sol.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as anchor from "@coral-xyz/anchor";
import { Program } from "@coral-xyz/anchor";
import { BN } from "bn.js";
import { TransferSol } from "../target/types/transfer_sol";
import * as anchor from '@coral-xyz/anchor';
import { Program } from '@coral-xyz/anchor';
import { BN } from 'bn.js';
import { TransferSol } from '../target/types/transfer_sol';

describe("transfer_sol", () => {
describe('transfer_sol', () => {
//UTILS
const confirm = async (signature: string): Promise<string> => {
const block = await provider.connection.getLatestBlockhash();
Expand All @@ -28,14 +28,12 @@ describe("transfer_sol", () => {
const airdropAmount = 2.5 * anchor.web3.LAMPORTS_PER_SOL;
const transferAmount = 1 * anchor.web3.LAMPORTS_PER_SOL;

it("Airdrop", async () => {
const airdropMaker = await provider.connection
.requestAirdrop(maker.publicKey, airdropAmount)
.then(confirm);
console.log("\nAirdropped 5 SOL to maker", airdropMaker);
it('Airdrop', async () => {
const airdropMaker = await provider.connection.requestAirdrop(maker.publicKey, airdropAmount).then(confirm);
console.log('\nAirdropped 5 SOL to maker', airdropMaker);
});

it("Transfer token", async () => {
it('Transfer token', async () => {
// Add your test here.
const tx = await program.methods
.transferWithProgram(new BN(transferAmount))
Expand All @@ -45,6 +43,6 @@ describe("transfer_sol", () => {
})
.signers([maker])
.rpc();
console.log("Your transaction signature", tx);
console.log('Your transaction signature', tx);
});
});
13 changes: 2 additions & 11 deletions tokens/transfer-tokens/poseidon/ts-programs/src/transferSol.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
import {
Pubkey,
Result,
Signer,
SystemAccount,
SystemProgram,
u64,
} from "@solanaturbine/poseidon";
import { Pubkey, Result, Signer, SystemAccount, SystemProgram, u64 } from '@solanaturbine/poseidon';

export default class TransferSol {
static PROGRAM_ID = new Pubkey(
"HU7QEokj5qUUV5ryZYL7EhsqiAkxJyMVXc3DesKyCqtF"
);
static PROGRAM_ID = new Pubkey('HU7QEokj5qUUV5ryZYL7EhsqiAkxJyMVXc3DesKyCqtF');

transferWithProgram(from: Signer, to: SystemAccount, amount: u64): Result {
SystemProgram.transfer(from, to, amount);
Expand Down

0 comments on commit 61fe4f0

Please sign in to comment.