feat: serde for targets

This commit is contained in:
John Guibas 2023-09-06 09:22:54 -07:00
parent a7096546f1
commit 800603d6f1
2 changed files with 6 additions and 2 deletions

View File

@ -1,12 +1,14 @@
use alloc::vec::Vec;
use core::ops::Range;
use serde::{Deserialize, Serialize};
use crate::iop::ext_target::ExtensionTarget;
use crate::iop::wire::Wire;
use crate::plonk::circuit_data::CircuitConfig;
/// A location in the witness.
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)]
pub enum Target {
Wire(Wire),
/// A target that doesn't have any inherent location in the witness (but it can be copied to

View File

@ -1,10 +1,12 @@
use alloc::vec::Vec;
use core::ops::Range;
use serde::{Deserialize, Serialize};
use crate::plonk::circuit_data::CircuitConfig;
/// Represents a wire in the circuit, seen as a `degree x num_wires` table.
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Serialize, Deserialize)]
pub struct Wire {
/// Row index of the wire.
pub row: usize,