|
@@ -12,6 +12,7 @@ use anchor_spl::{
|
|
|
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
|
|
|
|
|
|
pub const MY_SEED: [u8; 2] = *b"hi";
|
|
|
+pub const MY_SEED_BYTES: &[u8] = b"hi";
|
|
|
pub const MY_SEED_STR: &str = "hi";
|
|
|
pub const MY_SEED_U8: u8 = 1;
|
|
|
pub const MY_SEED_U32: u32 = 2;
|
|
@@ -39,6 +40,10 @@ pub mod pda_derivation {
|
|
|
Ok(())
|
|
|
}
|
|
|
|
|
|
+ pub fn test_seed_constant(_ctx: Context<TestSeedConstant>) -> Result<()> {
|
|
|
+ Ok(())
|
|
|
+ }
|
|
|
+
|
|
|
pub fn associated_token_resolution(_ctx: Context<AssociatedTokenResolution>) -> Result<()> {
|
|
|
Ok(())
|
|
|
}
|
|
@@ -127,6 +132,21 @@ pub struct Nested<'info> {
|
|
|
account_nested: AccountInfo<'info>,
|
|
|
}
|
|
|
|
|
|
+#[derive(Accounts)]
|
|
|
+pub struct TestSeedConstant<'info> {
|
|
|
+ #[account(mut)]
|
|
|
+ my_account: Signer<'info>,
|
|
|
+ #[account(
|
|
|
+ init,
|
|
|
+ payer = my_account,
|
|
|
+ seeds = [MY_SEED_BYTES],
|
|
|
+ space = 100,
|
|
|
+ bump,
|
|
|
+ )]
|
|
|
+ account: Account<'info, MyAccount>,
|
|
|
+ system_program: Program<'info, System>,
|
|
|
+}
|
|
|
+
|
|
|
#[derive(Accounts)]
|
|
|
pub struct AssociatedTokenResolution<'info> {
|
|
|
#[account(
|