Skip to content

Commit 1fc9658

Browse files
committed
adjust program address derivation method
1 parent d8eb84a commit 1fc9658

File tree

4 files changed

+22
-21
lines changed

4 files changed

+22
-21
lines changed

Cargo.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pinocchio/interface/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ codama = ["dep:codama", "dep:codama-macros"]
1616
[dependencies]
1717
codama = { version = "0.7.3", optional = true }
1818
codama-macros = { version = "0.7.3", optional = true }
19-
solana-address = { version = "2.2.0", features = ["curve25519", "decode"] }
19+
solana-address = { version = "2.3.0", features = ["curve25519", "decode"] }
2020

2121
[package.metadata.solana]
2222
program-id = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"

pinocchio/interface/src/pda.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@ impl AssociatedTokenPda {
2626
token_program_id: &Address,
2727
token_mint_address: &Address,
2828
) -> (Address, u8) {
29-
Address::find_program_address(
29+
Address::derive_program_address(
3030
&[
3131
wallet_address.as_ref(),
3232
token_program_id.as_ref(),
3333
token_mint_address.as_ref(),
3434
],
3535
program_id,
3636
)
37+
.expect("Unable to find a viable program address bump seed")
3738
}
3839
}

pinocchio/program/src/create.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn is_valid_existing_ata_for_idempotent(
4343
return Ok(false);
4444
};
4545

46-
// Now that ATA is confirmed, it must match the wallet or mint supplied
46+
// Now that ATA is confirmed, it must match the wallet and mint supplied
4747
if token_account.owner() != wallet.address() {
4848
return Err(AssociatedTokenAccountError::InvalidOwner.to_program_err());
4949
}

0 commit comments

Comments
 (0)