mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-25 03:11:21 +00:00
chore: fmt + artifacts
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -270,9 +270,10 @@ mod tests {
|
||||
timestamp_validity_window: TimestampValidityWindow::new_unbounded(),
|
||||
};
|
||||
let bytes = output.to_bytes();
|
||||
let decoded: PrivacyPreservingCircuitOutput =
|
||||
borsh::from_slice(crate::from_frame(&bytes).expect("self-produced frame is well-formed"))
|
||||
.unwrap();
|
||||
let decoded: PrivacyPreservingCircuitOutput = borsh::from_slice(
|
||||
crate::from_frame(&bytes).expect("self-produced frame is well-formed"),
|
||||
)
|
||||
.unwrap();
|
||||
assert_eq!(output, decoded);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,14 +117,13 @@ pub fn execute_and_prove_with_padded_inputs(
|
||||
&chained_call.instruction_data,
|
||||
)?;
|
||||
|
||||
let program_output: ProgramOutput = borsh::from_slice(
|
||||
from_frame(&inner_receipt.journal.bytes).ok_or_else(|| {
|
||||
let program_output: ProgramOutput =
|
||||
borsh::from_slice(from_frame(&inner_receipt.journal.bytes).ok_or_else(|| {
|
||||
LeeError::ProgramOutputDeserializationError(
|
||||
"malformed inner-receipt journal frame".to_owned(),
|
||||
)
|
||||
})?,
|
||||
)
|
||||
.map_err(|e| LeeError::ProgramOutputDeserializationError(e.to_string()))?;
|
||||
})?)
|
||||
.map_err(|e| LeeError::ProgramOutputDeserializationError(e.to_string()))?;
|
||||
|
||||
// TODO: remove clone
|
||||
program_outputs.push(program_output.clone());
|
||||
|
||||
@@ -81,8 +81,8 @@ impl Program {
|
||||
let framed = from_frame(&session_info.journal.bytes).ok_or_else(|| {
|
||||
LeeError::ProgramExecutionFailed("malformed program journal frame".to_owned())
|
||||
})?;
|
||||
let program_output =
|
||||
borsh::from_slice(framed).map_err(|e| LeeError::ProgramExecutionFailed(e.to_string()))?;
|
||||
let program_output = borsh::from_slice(framed)
|
||||
.map_err(|e| LeeError::ProgramExecutionFailed(e.to_string()))?;
|
||||
|
||||
Ok(program_output)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (u128, ProgramId, u32, Option<PdaSeed>);
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ 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 = borsh::to_vec(&instruction.amount)
|
||||
.expect("transfer instruction serialization");
|
||||
let transfer_instruction =
|
||||
borsh::to_vec(&instruction.amount).expect("transfer instruction serialization");
|
||||
|
||||
chained_calls.push(ChainedCall {
|
||||
program_id: instruction.token_program_id,
|
||||
|
||||
@@ -146,10 +146,8 @@ fn main() {
|
||||
// min_vault_balance and this call will panic, rolling back the entire
|
||||
// transaction.
|
||||
let invariant_instruction =
|
||||
borsh::to_vec(&FlashSwapInstruction::InvariantCheck {
|
||||
min_vault_balance,
|
||||
})
|
||||
.expect("invariant instruction serialization");
|
||||
borsh::to_vec(&FlashSwapInstruction::InvariantCheck { min_vault_balance })
|
||||
.expect("invariant instruction serialization");
|
||||
let call_3 = ChainedCall {
|
||||
program_id: self_program_id, // self-referential chained call
|
||||
pre_states: vec![vault_after_callback],
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::{
|
||||
account::AccountWithMetadata,
|
||||
program::{
|
||||
AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
},
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (u128, ProgramId);
|
||||
|
||||
|
||||
@@ -85,8 +85,8 @@ fn main() {
|
||||
};
|
||||
|
||||
// Forward auth_transfer_id and amount to P2 so it can call authenticated_transfer.
|
||||
let p2_instruction = borsh::to_vec(&(auth_transfer_id, amount))
|
||||
.expect("serialization is infallible");
|
||||
let p2_instruction =
|
||||
borsh::to_vec(&(auth_transfer_id, amount)).expect("serialization is infallible");
|
||||
|
||||
ProgramOutput::new(
|
||||
self_program_id,
|
||||
|
||||
@@ -22,8 +22,7 @@ fn main() {
|
||||
// chained_call.pre_states (this call's inputs, set by P1), which contains
|
||||
// victim(is_authorized=true). So authorized_accounts = {victim}, and the
|
||||
// subsequent check passes.
|
||||
let auth_transfer_instruction =
|
||||
borsh::to_vec(&amount).expect("serialization is infallible");
|
||||
let auth_transfer_instruction = borsh::to_vec(&amount).expect("serialization is infallible");
|
||||
|
||||
ProgramOutput::new(
|
||||
self_program_id,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
/// Proxy for spending from a private PDA via `simple_transfer`.
|
||||
///
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, ChainedCall, Claim, PdaSeed, ProgramId, ProgramInput, ProgramOutput,
|
||||
read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
/// Claims the sole `pre_state` as a PDA with `claim_seed`, then chains to `callee_program_id`
|
||||
/// delegating authorization with `delegated_seed` in `pda_seeds`. When `claim_seed ==
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, ChainedCall, Claim, InstructionData, PdaSeed, ProgramId, ProgramInput,
|
||||
ProgramOutput, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (
|
||||
PdaSeed,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
ChainedCall, InstructionData, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (
|
||||
Option<PdaSeed>,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, BlockValidityWindow, ChainedCall, ProgramId, ProgramInput, ProgramOutput,
|
||||
TimestampValidityWindow, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
/// A program that sets a block validity window on its output and chains to another program with a
|
||||
/// potentially different block validity window.
|
||||
|
||||
@@ -802,9 +802,7 @@ impl CrossZoneVerifier {
|
||||
if public_tx.message().program_id != programs::cross_zone_inbox().id() {
|
||||
return None;
|
||||
}
|
||||
match borsh::from_slice::<InboxInstruction>(
|
||||
&public_tx.message().instruction_data,
|
||||
) {
|
||||
match borsh::from_slice::<InboxInstruction>(&public_tx.message().instruction_data) {
|
||||
Ok(InboxInstruction::Dispatch(msg)) => Some(msg),
|
||||
// Only a dispatch carries a cross-zone message to re-derive; a genesis
|
||||
// `InitConfig` is not verifier-relevant.
|
||||
|
||||
@@ -65,14 +65,7 @@ impl borsh::BorshDeserialize for SequencerKey {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(
|
||||
Clone,
|
||||
Debug,
|
||||
PartialEq,
|
||||
Eq,
|
||||
borsh::BorshSerialize,
|
||||
borsh::BorshDeserialize,
|
||||
)]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, borsh::BorshSerialize, borsh::BorshDeserialize)]
|
||||
pub enum Instruction {
|
||||
/// Locks `amount` into the ownership account for `sequencer_key`. First
|
||||
/// use claims the account; later calls top up the same account.
|
||||
|
||||
@@ -2194,9 +2194,7 @@ fn finalize_unstake_ownership_account(tx: &LeeTransaction) -> Option<AccountId>
|
||||
return None;
|
||||
}
|
||||
|
||||
match borsh::from_slice::<sequencer_stake_core::Instruction>(
|
||||
&message.instruction_data,
|
||||
) {
|
||||
match borsh::from_slice::<sequencer_stake_core::Instruction>(&message.instruction_data) {
|
||||
Ok(sequencer_stake_core::Instruction::FinalizeUnstake) => {
|
||||
message.account_ids.first().copied()
|
||||
}
|
||||
@@ -2275,9 +2273,7 @@ fn extract_cross_zone_dispatch(tx: &LeeTransaction) -> Option<CrossZoneMessage>
|
||||
return None;
|
||||
}
|
||||
|
||||
match borsh::from_slice::<cross_zone_inbox_core::Instruction>(
|
||||
&message.instruction_data,
|
||||
) {
|
||||
match borsh::from_slice::<cross_zone_inbox_core::Instruction>(&message.instruction_data) {
|
||||
Ok(cross_zone_inbox_core::Instruction::Dispatch(msg)) => Some(msg),
|
||||
Ok(cross_zone_inbox_core::Instruction::InitConfig(_)) | Err(_) => None,
|
||||
}
|
||||
@@ -2384,8 +2380,7 @@ fn extract_bridge_deposit_id(tx: &LeeTransaction) -> Option<HashType> {
|
||||
}
|
||||
|
||||
let instruction =
|
||||
borsh::from_slice::<bridge_core::Instruction>(&message.instruction_data)
|
||||
.ok()?;
|
||||
borsh::from_slice::<bridge_core::Instruction>(&message.instruction_data).ok()?;
|
||||
|
||||
match instruction {
|
||||
bridge_core::Instruction::Deposit {
|
||||
@@ -2407,8 +2402,7 @@ fn extract_bridge_withdraw_data(tx: &LeeTransaction) -> Option<WithdrawArg> {
|
||||
}
|
||||
|
||||
let instruction =
|
||||
borsh::from_slice::<bridge_core::Instruction>(&message.instruction_data)
|
||||
.ok()?;
|
||||
borsh::from_slice::<bridge_core::Instruction>(&message.instruction_data).ok()?;
|
||||
|
||||
let bridge_core::Instruction::Withdraw {
|
||||
amount,
|
||||
|
||||
Binary file not shown.
@@ -1,8 +1,8 @@
|
||||
use authenticated_transfer_core::Instruction as AuthTransferInstruction;
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (u128, ProgramId, u32, Option<PdaSeed>);
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::{
|
||||
Timestamp,
|
||||
program::{
|
||||
AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
},
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (ProgramId, Timestamp); // (clock_program_id, timestamp)
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::{
|
||||
account::AccountId,
|
||||
program::{
|
||||
AccountPostState, ChainedCall, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
},
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
type Instruction = (ProgramId, ProgramId, AccountId, u128);
|
||||
// (faucet_program_id, vault_program_id, recipient_id, amount)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use borsh::to_vec;
|
||||
use lee_core::program::{
|
||||
AccountPostState, ChainedCall, PdaSeed, ProgramId, ProgramInput, ProgramOutput, read_lee_inputs,
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
/// Proxy for spending from a private PDA via `auth_transfer`.
|
||||
///
|
||||
|
||||
@@ -534,7 +534,8 @@ fn decode_send_ordinal(instruction_data: &[u8]) -> Option<u32> {
|
||||
|
||||
/// Decodes a `ping_receiver::Record` payload (borsh bytes) to text.
|
||||
fn decode_payload(payload: &[u8]) -> Option<String> {
|
||||
let instruction: ReceiverInstruction = borsh::from_slice::<ReceiverInstruction>(payload).ok()?;
|
||||
let instruction: ReceiverInstruction =
|
||||
borsh::from_slice::<ReceiverInstruction>(payload).ok()?;
|
||||
let ReceiverInstruction::Record { payload: bytes } = instruction else {
|
||||
return None;
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
use std::{collections::HashMap, time::Instant};
|
||||
|
||||
use borsh::to_vec;
|
||||
use lee::{
|
||||
execute_and_prove,
|
||||
privacy_preserving_transaction::circuit::{ProgramWithDependencies, Proof},
|
||||
@@ -13,7 +14,6 @@ use lee_core::{
|
||||
InputAccountIdentity, PrivacyPreservingCircuitOutput,
|
||||
account::{Account, AccountId, AccountWithMetadata},
|
||||
};
|
||||
use borsh::to_vec;
|
||||
|
||||
use super::PpeBenchResult;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user