Merge pull request #1214 from jtguibas/jtguibas/serde-target

feat: implement serde Serialize and Deserialize for Target
This commit is contained in:
Nicholas Ward 2023-09-06 13:24:48 -07:00 committed by GitHub
commit e6ca460623
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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,