feat: move initial accounts data into genesis

This commit is contained in:
Daniil Polyakov
2026-05-15 01:33:50 +03:00
parent e998ec7b99
commit 5f207a3f02
161 changed files with 5687 additions and 6118 deletions
+1
View File
@@ -9,6 +9,7 @@ workspace = true
[dependencies]
nssa_core.workspace = true
authenticated_transfer_core.workspace = true
clock_core.workspace = true
risc0-zkvm.workspace = true
@@ -1,3 +1,4 @@
use authenticated_transfer_core::Instruction as AuthTransferInstruction;
use nssa_core::program::{
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput,
read_nssa_inputs,
@@ -25,7 +26,7 @@ fn main() {
return;
};
let instruction_data = to_vec(&balance).unwrap();
let instruction_data = to_vec(&AuthTransferInstruction::Transfer { amount: balance }).unwrap();
let mut running_recipient_pre = recipient_pre.clone();
let mut running_sender_pre = sender_pre.clone();
@@ -63,7 +63,10 @@ fn main() {
// Mark the receiver as authorized since it will be PDA-authorized in this chained call.
let mut receiver_authorized = receiver_pre.clone();
receiver_authorized.is_authorized = true;
let transfer_instruction = risc0_zkvm::serde::to_vec(&instruction.amount)
let transfer_instruction =
risc0_zkvm::serde::to_vec(&authenticated_transfer_core::Instruction::Transfer {
amount: instruction.amount,
})
.expect("transfer instruction serialization");
chained_calls.push(ChainedCall {
@@ -123,7 +123,10 @@ fn main() {
let mut vault_authorized = vault_pre.clone();
vault_authorized.is_authorized = true;
let transfer_instruction =
risc0_zkvm::serde::to_vec(&amount_out).expect("transfer instruction serialization");
risc0_zkvm::serde::to_vec(&authenticated_transfer_core::Instruction::Transfer {
amount: amount_out,
})
.expect("transfer instruction serialization");
let call_1 = ChainedCall {
program_id: token_program_id,
pre_states: vec![vault_authorized, receiver_pre.clone()],
@@ -32,7 +32,8 @@ fn main() {
..sender.clone()
};
let instruction_data = to_vec(&balance).unwrap();
let instruction_data =
to_vec(&authenticated_transfer_core::Instruction::Transfer { amount: balance }).unwrap();
let chained_call = ChainedCall {
program_id: transfer_program_id,