Skip to content

Commit

Permalink
Merge branch 'develop' into data-streams/verifier-sdk-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
akuzni2 authored Feb 10, 2025
2 parents f3a89dc + ba7d77a commit 93c3de2
Show file tree
Hide file tree
Showing 9 changed files with 465 additions and 106 deletions.
50 changes: 44 additions & 6 deletions contracts/generated/contract_reader_interface/Initialize.go

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

128 changes: 128 additions & 0 deletions contracts/generated/contract_reader_interface/accounts.go

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

40 changes: 40 additions & 0 deletions contracts/programs/contract-reader-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ pub mod contract_reader_interface {
account.idx = test_idx;
account.bump = ctx.bumps.data;

let multi_read1 = &mut ctx.accounts.multi_read1;
multi_read1.a = 1;
multi_read1.b = 2;
multi_read1.c = true;

let multi_read2 = &mut ctx.accounts.multi_read2;
multi_read2.u = "Hello".to_string();
multi_read2.v = true;
multi_read2.w = [123, 456];

Ok(())
}

Expand Down Expand Up @@ -65,6 +75,22 @@ pub struct Initialize<'info> {
bump)]
pub data: Account<'info, DataAccount>,

#[account(
init_if_needed,
payer = signer,
space = size_of::<MultiRead1>() + 8,
seeds = [b"multi_read1"],
bump)]
pub multi_read1: Account<'info, MultiRead1>,

#[account(
init_if_needed,
payer = signer,
space = size_of::<MultiRead2>() + 8,
seeds = [b"multi_read2"],
bump)]
pub multi_read2: Account<'info, MultiRead2>,

pub system_program: Program<'info, System>,
}

Expand Down Expand Up @@ -197,3 +223,17 @@ pub struct InnerStaticTestStruct {
pub i: i64,
pub a: Pubkey,
}

#[account]
pub struct MultiRead1 {
pub a: u8,
pub b: i16,
pub c: bool,
}

#[account]
pub struct MultiRead2 {
pub u: String,
pub v: bool,
pub w: [u64; 2],
}
Loading

0 comments on commit 93c3de2

Please sign in to comment.