mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-04-17 08:33:11 +00:00
fix: cargo fmt, add #[must_use] to private_pda_account_id, rebuild artifacts
This commit is contained in:
parent
7e63f9ddcd
commit
b0c10ee5a2
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.
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.
@ -62,14 +62,14 @@ impl From<(&ProgramId, &PdaSeed)> for AccountId {
|
||||
///
|
||||
/// Unlike public PDAs (`AccountId::from((&ProgramId, &PdaSeed))`), this includes the `npk` in the
|
||||
/// derivation, making the address unique per group of controllers sharing viewing keys.
|
||||
#[must_use]
|
||||
pub fn private_pda_account_id(
|
||||
program_id: &ProgramId,
|
||||
seed: &PdaSeed,
|
||||
npk: &NullifierPublicKey,
|
||||
) -> AccountId {
|
||||
use risc0_zkvm::sha::{Impl, Sha256 as _};
|
||||
const PRIVATE_PDA_PREFIX: &[u8; 32] =
|
||||
b"/LEE/v0.3/AccountId/PrivatePDA/\x00";
|
||||
const PRIVATE_PDA_PREFIX: &[u8; 32] = b"/LEE/v0.3/AccountId/PrivatePDA/\x00";
|
||||
|
||||
let mut bytes = [0u8; 128];
|
||||
bytes[0..32].copy_from_slice(PRIVATE_PDA_PREFIX);
|
||||
|
||||
@ -282,10 +282,11 @@ impl ExecutionState {
|
||||
let (_, _, npk) = private_pda_info
|
||||
.iter()
|
||||
.find(|(pid, s, _)| *pid == program_id && s == &seed)
|
||||
.expect("mask-3 PDA claim must have a matching private_pda_info entry");
|
||||
let pda = nssa_core::program::private_pda_account_id(
|
||||
&program_id, &seed, npk,
|
||||
);
|
||||
.expect(
|
||||
"mask-3 PDA claim must have a matching private_pda_info entry",
|
||||
);
|
||||
let pda =
|
||||
nssa_core::program::private_pda_account_id(&program_id, &seed, npk);
|
||||
assert_eq!(
|
||||
pre_account_id, pda,
|
||||
"Invalid private PDA claim for account {pre_account_id}"
|
||||
@ -602,8 +603,12 @@ fn main() {
|
||||
private_pda_info,
|
||||
} = env::read();
|
||||
|
||||
let execution_state =
|
||||
ExecutionState::derive_from_outputs(&visibility_mask, program_id, program_outputs, &private_pda_info);
|
||||
let execution_state = ExecutionState::derive_from_outputs(
|
||||
&visibility_mask,
|
||||
program_id,
|
||||
program_outputs,
|
||||
&private_pda_info,
|
||||
);
|
||||
|
||||
let output = compute_circuit_output(
|
||||
execution_state,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user