Skip to content

Commit

Permalink
chore: fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
mindrunner committed May 21, 2024
1 parent 73f933b commit 473d398
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 27 deletions.
33 changes: 10 additions & 23 deletions src/factions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,14 @@ export async function enlistToFaction(
const idl = getIDL(programId);
const provider = new AnchorProvider(connection, null, null);
const program = new Program(<Idl>idl, programId, provider);
const txInstruction = await program.instruction.processEnlistPlayer(
bump,
factionID,
{
accounts: {
playerFactionAccount: playerFactionPda,
playerAccount: playerPublicKey,
systemProgram: web3.SystemProgram.programId,
clock: web3.SYSVAR_CLOCK_PUBKEY,
},
return await program.instruction.processEnlistPlayer(bump, factionID, {
accounts: {
playerFactionAccount: playerFactionPda,
playerAccount: playerPublicKey,
systemProgram: web3.SystemProgram.programId,
clock: web3.SYSVAR_CLOCK_PUBKEY,
},
);

return txInstruction;
});
}

/**
Expand All @@ -241,8 +235,7 @@ export async function getPlayer(
const idl = getIDL(programId);
const program = new Program(<Idl>idl, programId, provider);

const [playerFactionPDA] = getPlayerFactionPDA(playerPublicKey, programId,
);
const [playerFactionPDA] = getPlayerFactionPDA(playerPublicKey, programId);
const obj = await program.account.playerFactionData.fetch(playerFactionPDA);
return obj as PlayerFaction;
}
Expand All @@ -260,11 +253,7 @@ export async function getAllPlayers(
const program = new Program(<Idl>idl, programId, provider);
const programAccounts = await program.account.playerFactionData.all();

const players = programAccounts.map(
(player) => <PlayerFaction>player.account,
);

return players;
return programAccounts.map((player) => <PlayerFaction>player.account);
}

/**
Expand All @@ -281,9 +270,7 @@ export async function getPlayersOfFaction(
const program = new Program(<Idl>idl, programId, provider);
const programAccounts = await program.account.playerFactionData.all();

const filtered = programAccounts
return programAccounts
.map((player) => <PlayerFaction>player.account)
.filter((player) => player.factionId == factionID);

return filtered;
}
7 changes: 3 additions & 4 deletions src/marketplace/pda_getters/pda_info_getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import {
getMarketVarsAccount,
getRegisteredCurrencyAccount,
} from './pda_getters';
import { getMarketplaceProgram } from './../utils/getMarketplaceProgram';
import { getMarketplaceProgram } from '../utils';
import {
FeeExemptInfo,
MarketVarsAccountInfo,
RegisteredCurrencyInfo,
RoyaltyTiers,
} from '../types/marketplace_accounts';
} from '../types';
import { getStakingAccount, getStakingAccountInfo } from '../../atlas-staking';

/**
Expand Down Expand Up @@ -44,8 +44,7 @@ export async function getFeeExemptAccountInfo(
programId: programId,
});

const [feeExemptAccount] = getFeeExemptAccount(targetAccount, programId,
);
const [feeExemptAccount] = getFeeExemptAccount(targetAccount, programId);
const feeExemptInfo = await program.account.feeExempt.fetch(feeExemptAccount);
return feeExemptInfo as FeeExemptInfo;
}
Expand Down

0 comments on commit 473d398

Please sign in to comment.