Skip to content

Commit

Permalink
1074 - msgpack_derived_equals (addressing review comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanmon committed Aug 30, 2023
1 parent b1db37f commit dd8ad16
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

#include "aztec3/circuits/abis/historic_block_data.hpp"
#include "aztec3/utils/types/circuit_types.hpp"
#include "aztec3/utils/types/convert.hpp"
#include "aztec3/utils/types/native_types.hpp"

#include <barretenberg/barretenberg.hpp>
Expand All @@ -27,7 +26,7 @@ template <typename NCT> struct CombinedConstantData {
MSGPACK_FIELDS(block_data, tx_context);
boolean operator==(CombinedConstantData<NCT> const& other) const
{
return block_data == other.block_data && tx_context == other.tx_context;
return msgpack_derived_equals<boolean>(*this, other);
}

template <typename Builder> CombinedConstantData<CircuitTypes<Builder>> to_circuit_type(Builder& builder) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,7 @@ template <typename NCT> struct FinalAccumulatedData {
optionally_revealed_data);
boolean operator==(FinalAccumulatedData<NCT> const& other) const
{
return aggregation_object == other.aggregation_object && new_commitments == other.new_commitments &&
new_nullifiers == other.new_nullifiers && nullified_commitments == other.nullified_commitments &&
private_call_stack == other.private_call_stack && public_call_stack == other.public_call_stack &&
new_l2_to_l1_msgs == other.new_l2_to_l1_msgs && encrypted_logs_hash == other.encrypted_logs_hash &&
unencrypted_logs_hash == other.unencrypted_logs_hash &&
encrypted_log_preimages_length == other.encrypted_log_preimages_length &&
unencrypted_log_preimages_length == other.unencrypted_log_preimages_length &&
new_contracts == other.new_contracts && optionally_revealed_data == other.optionally_revealed_data;
return msgpack_derived_equals<boolean>(*this, other);
};

template <typename Builder> FinalAccumulatedData<CircuitTypes<Builder>> to_circuit_type(Builder& builder) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ template <typename NCT> struct KernelCircuitPublicInputs {

boolean operator==(KernelCircuitPublicInputs<NCT> const& other) const
{
return end == other.end && constants == other.constants && is_private == other.is_private;
return msgpack_derived_equals<boolean>(*this, other);
};

template <typename Builder> KernelCircuitPublicInputs<CircuitTypes<Builder>> to_circuit_type(Builder& builder) const
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ template <typename NCT> struct KernelCircuitPublicInputsFinal {

boolean operator==(KernelCircuitPublicInputsFinal<NCT> const& other) const
{
return end == other.end && constants == other.constants && is_private == other.is_private;
};
return msgpack_derived_equals<boolean>(*this, other);
}

template <typename Builder>
KernelCircuitPublicInputsFinal<CircuitTypes<Builder>> to_circuit_type(Builder& builder) const
Expand Down

0 comments on commit dd8ad16

Please sign in to comment.