Skip to content

Commit

Permalink
Derive PartialEq, Eq for ExecutionError
Browse files Browse the repository at this point in the history
  • Loading branch information
plafer committed Nov 9, 2023
1 parent 01ee16a commit ad072cc
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion core/src/program/blocks/call_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::utils::to_hex;
/// > hash(fn_hash || padding, domain=SYSCALL_DOMAIN) # when a syscall is used
///
/// Where `fn_hash` is 4 field elements (256 bits), and `padding` is 4 ZERO elements (256 bits).
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Call {
hash: Digest,
fn_hash: Digest,
Expand Down
2 changes: 1 addition & 1 deletion core/src/program/blocks/dyn_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const DYN_CONSTANT: Digest = Digest::new([
/// affect the representation of the Dyn block. Therefore all Dyn blocks are represented by the same
/// constant (rather than by unique hashes), which is computed as an RPO hash of two empty words
/// ([ZERO, ZERO, ZERO, ZERO]) with a domain value of `DYN_DOMAIN`.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Dyn {}

impl Dyn {
Expand Down
2 changes: 1 addition & 1 deletion core/src/program/blocks/join_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use super::{fmt, hasher, Box, CodeBlock, Digest, Felt, Operation};
/// > hash(left_block_hash || right_block_hash, domain=JOIN_DOMAIN)
///
/// Where `left_block_hash` and `right_block_hash` are 4 field elements (256 bits) each.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Join {
body: Box<[CodeBlock; 2]>,
hash: Digest,
Expand Down
2 changes: 1 addition & 1 deletion core/src/program/blocks/loop_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{fmt, hasher, Box, CodeBlock, Digest, Felt, Operation};
/// > hash(body_hash || padding, domain=LOOP_DOMAIN)
///
/// Where `body_hash` is 4 field elements (256 bits), and `padding` is 4 ZERO elements (256 bits).
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Loop {
body: Box<CodeBlock>,
hash: Digest,
Expand Down
2 changes: 1 addition & 1 deletion core/src/program/blocks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub use split_block::Split;
// PROGRAM BLOCK
// ================================================================================================
/// TODO: add comments
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum CodeBlock {
Span(Span),
Join(Join),
Expand Down
2 changes: 1 addition & 1 deletion core/src/program/blocks/proxy_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use super::{fmt, Digest};
/// of the program secret. Fails if executed.
///
/// Hash of a proxy block is not computed but is rather defined at instantiation time.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Proxy {
hash: Digest,
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/program/blocks/span_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const MAX_OPS_PER_BATCH: usize = GROUP_SIZE * BATCH_SIZE;
///
/// Where `batches` is the concatenation of each `batch` in the span, and each batch is 8 field
/// elements (512 bits).
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Span {
op_batches: Vec<OpBatch>,
hash: Digest,
Expand Down Expand Up @@ -170,7 +170,7 @@ impl fmt::Display for Span {
///
/// An operation batch consists of up to 8 operation groups, with each group containing up to 9
/// operations or a single immediate value.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct OpBatch {
ops: Vec<Operation>,
groups: [Felt; BATCH_SIZE],
Expand Down
2 changes: 1 addition & 1 deletion core/src/program/blocks/split_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use super::{fmt, hasher, Box, CodeBlock, Digest, Felt, Operation};
/// > hash(true_branch_hash || false_branch_hash, domain=SPLIT_DOMAIN)
///
/// Where `true_branch_hash` and `false_branch_hash` are 4 field elements (256 bits) each.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Split {
branches: Box<[CodeBlock; 2]>,
hash: Digest,
Expand Down
4 changes: 2 additions & 2 deletions processor/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::error::Error;
// EXECUTION ERROR
// ================================================================================================

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum ExecutionError {
AdviceMapKeyNotFound(Word),
AdviceMapValueInvalidLength(Word, usize, usize),
Expand Down Expand Up @@ -169,7 +169,7 @@ impl From<Ext2InttError> for ExecutionError {
// EXT2INTT ERROR
// ================================================================================================

#[derive(Debug)]
#[derive(Debug, PartialEq, Eq)]
pub enum Ext2InttError {
DomainSizeNotPowerOf2(u64),
DomainSizeTooSmall(u64),
Expand Down

0 comments on commit ad072cc

Please sign in to comment.