Skip to content

Commit

Permalink
Merge pull request #133 from staratlasmeta/fix/hardcoded-faction-enli…
Browse files Browse the repository at this point in the history
…stment-program-id

fix: hardcoded faction enlistment program ID
  • Loading branch information
Buzzec authored May 16, 2023
2 parents caa4787 + 8c3b2cb commit 52ab3e8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@staratlas/factory",
"version": "0.5.2",
"version": "0.5.3",
"description": "Star Atlas Factory for constructing Transactions targeting Solana on-chain programs",
"repository": {
"type": "git",
Expand Down
11 changes: 5 additions & 6 deletions src/score.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ import { scoreLogBaseIdl } from './util/scoreLogIdl';
import { getTokenAccount } from './util';
import * as SCORE_TYPES from './util/scoreIdl';

const factionProgramId = new web3.PublicKey(
'FACTNmq2FhA2QNTnGM2aWJH3i7zT3cND5CgvjYTjyVYe'
);

export type SCORE_PROGRAM = SCORE_TYPES.Score;
export type ScoreTypes = AnchorTypes<SCORE_PROGRAM>;
type Account = ScoreTypes['Accounts'];
Expand Down Expand Up @@ -565,7 +561,10 @@ export async function createInitialDepositInstruction(
shipQuantity: number,
shipMint: web3.PublicKey,
shipTokenAccount: web3.PublicKey,
programId: web3.PublicKey
programId: web3.PublicKey,
factionEnlistmentProgramId: web3.PublicKey = new web3.PublicKey(
'FACTNmq2FhA2QNTnGM2aWJH3i7zT3cND5CgvjYTjyVYe'
)
): Promise<web3.TransactionInstruction> {
const [escrowAuthority, escrowAuthBump] = await getScoreEscrowAuthAccount(
programId,
Expand All @@ -587,7 +586,7 @@ export async function createInitialDepositInstruction(
await getScoreVarsShipAccount(programId, shipMint);
const [playerFactionPDA] = await getPlayerFactionPDA(
playerPublicKey,
factionProgramId
factionEnlistmentProgramId
);

const idl = getScoreIDL(programId);
Expand Down

0 comments on commit 52ab3e8

Please sign in to comment.