mirror of
https://github.com/logos-co/nomos-pocs.git
synced 2025-01-11 01:45:51 +00:00
Provide state roots instead of whole state (#33)
This commit is contained in:
parent
5fd3c299c1
commit
ff0afeebd7
@ -165,7 +165,7 @@ pub fn prove_zone_fund_constraint(
|
||||
let private_inputs = SpendFundsPrivate {
|
||||
in_zone_funds,
|
||||
zone_note,
|
||||
state_witness: out_zone_state.clone(),
|
||||
state_roots: out_zone_state.state_roots(),
|
||||
};
|
||||
|
||||
let env = risc0_zkvm::ExecutorEnv::builder()
|
||||
|
@ -6,6 +6,6 @@ pub struct SpendFundsPrivate {
|
||||
pub in_zone_funds: cl::PartialTxInputWitness,
|
||||
/// The zone note that is authorizing the spend
|
||||
pub zone_note: cl::PartialTxOutputWitness,
|
||||
/// The state of the zone
|
||||
pub state_witness: common::StateWitness,
|
||||
/// Proof of identity of the above note
|
||||
pub state_roots: common::StateRoots,
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ fn main() {
|
||||
let SpendFundsPrivate {
|
||||
in_zone_funds,
|
||||
zone_note,
|
||||
state_witness,
|
||||
state_roots,
|
||||
} = env::read();
|
||||
|
||||
let input_root = in_zone_funds.input_root();
|
||||
@ -20,11 +20,8 @@ fn main() {
|
||||
let ptx_root = PtxRoot(merkle::node(input_root, output_root));
|
||||
|
||||
// 1) Check the zone note is the correct one
|
||||
assert_eq!(
|
||||
in_zone_funds.input.note.state,
|
||||
state_witness.zone_metadata.id()
|
||||
);
|
||||
assert_eq!(zone_note.output.note.state, state_witness.commit().0);
|
||||
assert_eq!(in_zone_funds.input.note.state, state_roots.zone_id);
|
||||
assert_eq!(zone_note.output.note.state, state_roots.commit().0);
|
||||
|
||||
let nf = in_zone_funds.input.nullifier();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user