Refactoring: SproutNote member variable value moved to BaseNote.
All notes have a value, so the member variable has been moved to the base class, and direct member access has been replaced with a getter.
This commit is contained in:
@@ -222,7 +222,7 @@ public:
|
||||
// Witness total_uint64 bits
|
||||
uint64_t left_side_acc = vpub_old;
|
||||
for (size_t i = 0; i < NumInputs; i++) {
|
||||
left_side_acc += inputs[i].note.value;
|
||||
left_side_acc += inputs[i].note.value();
|
||||
}
|
||||
|
||||
zk_total_uint64.fill_with_bits(
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
void generate_r1cs_witness(const SproutNote& note) {
|
||||
r->bits.fill_with_bits(this->pb, uint256_to_bool_vector(note.r));
|
||||
value.fill_with_bits(this->pb, uint64_to_bool_vector(note.value));
|
||||
value.fill_with_bits(this->pb, uint64_to_bool_vector(note.value()));
|
||||
}
|
||||
};
|
||||
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
);
|
||||
|
||||
// Set enforce flag for nonzero input value
|
||||
this->pb.val(value_enforce) = (note.value != 0) ? FieldT::one() : FieldT::zero();
|
||||
this->pb.val(value_enforce) = (note.value() != 0) ? FieldT::one() : FieldT::zero();
|
||||
|
||||
// Witness merkle tree authentication path
|
||||
witness_input->generate_r1cs_witness(path);
|
||||
|
||||
Reference in New Issue
Block a user