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

chore: fix linter #178

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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