Skip to content

Commit 6bdf7f3

Browse files
committed
Fixed test cases and updated poseidon
1 parent 79979cd commit 6bdf7f3

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

basics/account-data/poseidon/programs/account_data/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ pub mod address_info_program {
3434
}
3535
#[derive(Accounts)]
3636
pub struct InitializeContext<'info> {
37-
#[account(mut)]
38-
pub owner: Signer<'info>,
3937
#[account(
4038
init,
4139
payer = owner,
@@ -45,6 +43,8 @@ pub struct InitializeContext<'info> {
4543
bump,
4644
)]
4745
pub state: Account<'info, AddressInfoState>,
46+
#[account(mut)]
47+
pub owner: Signer<'info>,
4848
pub system_program: Program<'info, System>,
4949
}
5050
#[derive(Accounts)]

basics/account-data/poseidon/tests/account_data.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import { startAnchor } from 'solana-bankrun';
66
import { AddressInfoProgram } from '../target/types/address_info_program';
77

88
describe('Address Info Program', () => {
9-
109
const IDL = require('../target/idl/address_info_program.json');
11-
10+
1211
const PROGRAM_ID = new PublicKey(IDL.address);
1312

1413
// Test setup
@@ -23,15 +22,15 @@ describe('Address Info Program', () => {
2322
// Initialize program test environment
2423
const context = await startAnchor(
2524
'.', // Path to Anchor.toml
26-
[], // No extra programs needed
27-
[], // No
25+
[],
26+
[],
2827
);
2928

3029
// Set up provider and program
3130
provider = new BankrunProvider(context);
3231

3332
// Get program from workspace
34-
program = new Program(IDL, provider);
33+
program = new Program<AddressInfoProgram>(IDL, provider);
3534

3635
owner = provider.wallet as Wallet;
3736

basics/account-data/poseidon/ts-programs/src/accountData.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface AddressInfoState extends Account {
1717
*/
1818
export default class AddressInfoProgram {
1919
// Following Poseidon example pattern of static PROGRAM_ID
20-
static PROGRAM_ID = new Pubkey("ChA1o71vBEwkYNs6FnkmG4cxyZWtWkbXSEJ6xP2zaJAq");
20+
static PROGRAM_ID = new Pubkey('ChA1o71vBEwkYNs6FnkmG4cxyZWtWkbXSEJ6xP2zaJAq');
2121

2222
initialize(owner: Signer, state: AddressInfoState, houseNumber: u8, streetNumber: u16, zipCode: u32, countryCode: u16): Result {
2323
// Use derive() for PDA creation and init() for initialization

0 commit comments

Comments
 (0)