Skip to content

Commit e0dd1bc

Browse files
committed
Update scaffolding
1 parent 37fe75c commit e0dd1bc

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎examples/tree/interface/src/asm.rs‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::bindings::{
44
SolAccountInfo, SolAccountMeta, SolInstruction, SolSignerSeed, SolSignerSeeds,
55
};
66
use crate::common::{
7-
cpi, CreateAccountInstructionData, InitInputBuffer, InitializeInstruction, InputBufferHeader,
8-
InsertInstruction, Instruction, TreeHeader, TreeNode,
7+
cpi, CreateAccountInstructionData, GeneralInputBufferHeader, InitInputBuffer,
8+
InitializeInstruction, InputBufferHeader, InsertInstruction, Instruction, TreeHeader, TreeNode,
99
};
1010
use macros::{asm_constant_group, extend_constant_group, pubkey_chunk_group, sizes, stack_frame};
1111
use pinocchio::{
@@ -36,6 +36,8 @@ extend_constant_group!(data {
3636
DATA_LEN_AND_MASK = -8,
3737
/// Maximum possible data length padding.
3838
MAX_DATA_PAD = 7,
39+
/// Boolean true value.
40+
BOOL_TRUE = 1,
3941
});
4042

4143
extend_constant_group!(input_buffer {
@@ -67,6 +69,8 @@ extend_constant_group!(input_buffer {
6769
pubkey_value!(RENT_ID, RENT_ID),
6870
/// Program ID field for initialize instruction.
6971
offset_immediate!(INIT_PROGRAM_ID, InitInputBuffer.footer.program_id),
72+
/// Tree top pointer field within tree data.
73+
offset!(TREE_DATA_TOP, GeneralInputBufferHeader.tree_data.top),
7074
/// Relative offset from user data field to tree pubkey field.
7175
relative_offset_immediate!(
7276
USER_DATA,

‎examples/tree/interface/src/common.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,15 @@ pub struct InitInputBufferHeader {
164164
pub rent: RentRuntimeAccount,
165165
}
166166

167+
#[repr(C, packed)]
168+
/// Input buffer header for general tree instructions.
169+
pub struct GeneralInputBufferHeader {
170+
pub n_accounts: u64,
171+
pub user: EmptyRuntimeAccount,
172+
pub tree_header: RuntimeAccountHeader,
173+
pub tree_data: TreeHeader,
174+
}
175+
167176
// ANCHOR: tree-defs-common
168177
#[repr(u8)]
169178
pub enum Color {

‎examples/tree/src/tests.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ fn test_entrypoint_branching() {
169169

170170
#[test]
171171
fn test_insert() {
172-
print_comparison_table(insert::InsertCase::CASES, true, false);
172+
print_comparison_table(insert::InsertCase::CASES, false, false);
173173
}
174174

175175
#[test]

0 commit comments

Comments
 (0)