Skip to content

Commit

Permalink
add operator== to JamtisPaymentProposals (monero-project#18)
Browse files Browse the repository at this point in the history
* add operator== to JamtisPaymentProposals

---------

Co-authored-by: DangerousFreedom <monero-inflation-checker@protonmail.com>\
  • Loading branch information
DangerousFreedom1984 authored and UkoeHB committed Feb 8, 2024
1 parent d986eac commit 0fea624
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/seraphis_core/jamtis_payment_proposal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ static void get_output_proposal_address_parts_v1(const rct::key &q,
}
//-------------------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------------
/// equality operators
bool operator==(const JamtisPaymentProposalV1 a, const JamtisPaymentProposalV1 b)
{
return a.destination == b.destination && a.amount == b.amount &&
a.enote_ephemeral_privkey == b.enote_ephemeral_privkey && a.partial_memo == b.partial_memo;
}
//-------------------------------------------------------------------------------------------------------------------
bool operator==(const JamtisPaymentProposalSelfSendV1 a, const JamtisPaymentProposalSelfSendV1 b)
{
return a.destination == b.destination && a.amount == b.amount && a.type == b.type &&
a.enote_ephemeral_privkey == b.enote_ephemeral_privkey && a.partial_memo == b.partial_memo;
}
//-------------------------------------------------------------------------------------------------------------------
void get_enote_ephemeral_pubkey(const JamtisPaymentProposalV1 &proposal,
crypto::x25519_pubkey &enote_ephemeral_pubkey_out)
{
Expand Down
4 changes: 4 additions & 0 deletions src/seraphis_core/jamtis_payment_proposal.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ struct JamtisPaymentProposalSelfSendV1 final
TxExtra partial_memo;
};

/// equality operators
bool operator==(const JamtisPaymentProposalV1 a, const JamtisPaymentProposalV1 b);
bool operator==(const JamtisPaymentProposalSelfSendV1 a, const JamtisPaymentProposalSelfSendV1 b);

/**
* brief: get_enote_ephemeral_pubkey - get the proposal's enote ephemeral pubkey xK_e
* param: proposal -
Expand Down

0 comments on commit 0fea624

Please sign in to comment.