Skip to content

Commit bd377c9

Browse files
committed
fix: update signers for token lottery
1 parent 4eb6377 commit bd377c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

project-8-token-lottery/programs/token-lottery/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ pub struct Initialize<'info> {
352352
payer = payer,
353353
mint::decimals = 0,
354354
mint::authority = collection_mint,
355-
seeds = [token_lottery.key().as_ref()],
355+
seeds = [b"collection_mint".as_ref()],
356356
bump,
357357
)]
358358
pub collection_mint: Box<InterfaceAccount<'info, Mint>>,

project-8-token-lottery/tests/token-lottery.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ describe("token-lottery", () => {
1717

1818
it("Is initialized!", async () => {
1919

20-
const mintKeypair = Keypair.generate();
21-
const mint = mintKeypair.publicKey;
20+
const mint = anchor.web3.PublicKey.findProgramAddressSync(
21+
[Buffer.from('collection_mint')],
22+
program.programId,
23+
)[0];
2224

2325
const metadata = anchor.web3.PublicKey.findProgramAddressSync(
2426
[Buffer.from('metadata'), TOKEN_METADATA_PROGRAM_ID.toBuffer(), mint.toBuffer()],

0 commit comments

Comments
 (0)