mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-08-25 06:41:13 +00:00
feat: move initial accounts data into genesis
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user