Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request 0xPolygonZero#1214 from jtguibas/jtguibas/serde-ta…
Browse files Browse the repository at this point in the history
…rget

feat: implement serde Serialize and Deserialize for Target
  • Loading branch information
npwardberkeley authored Sep 6, 2023
2 parents 5690b95 + 800603d commit e6ca460
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion plonky2/src/iop/target.rs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 3 additions & 1 deletion plonky2/src/iop/wire.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down

0 comments on commit e6ca460

Please sign in to comment.