-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Sapling builder to separate out proof generation #1023
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,6 +123,14 @@ impl Sub<&ValueCommitTrapdoor> for ValueCommitTrapdoor { | |
} | ||
} | ||
|
||
impl Sub<TrapdoorSum> for TrapdoorSum { | ||
type Output = TrapdoorSum; | ||
|
||
fn sub(self, rhs: Self) -> Self::Output { | ||
TrapdoorSum(self.0 - rhs.0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based upon the other uses of None of this is blocking; it's probably fine for this to be done ad-hoc, but just something I'd like us to think about, given that I've been considering similar issues for ZEC amounts. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed these Sapling types have been somewhat ad-hoc constructed, and we should do a full pass over both these Sapling types (some of which pre-date the
A A In the |
||
} | ||
} | ||
|
||
impl SubAssign<&ValueCommitTrapdoor> for TrapdoorSum { | ||
fn sub_assign(&mut self, rhs: &ValueCommitTrapdoor) { | ||
self.0 -= rhs.0; | ||
|
@@ -207,6 +215,14 @@ impl SubAssign<&ValueCommitment> for CommitmentSum { | |
} | ||
} | ||
|
||
impl Sub<CommitmentSum> for CommitmentSum { | ||
type Output = CommitmentSum; | ||
|
||
fn sub(self, rhs: Self) -> Self::Output { | ||
CommitmentSum(self.0 - rhs.0) | ||
} | ||
} | ||
|
||
impl Sum<ValueCommitment> for CommitmentSum { | ||
fn sum<I: Iterator<Item = ValueCommitment>>(iter: I) -> Self { | ||
iter.fold(CommitmentSum::zero(), |acc, cv| acc + &cv) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: #1017