Skip to content

Commit

Permalink
fix: use TransactionMustHaveAnInput from ringct
Browse files Browse the repository at this point in the history
* remove Error::TransactionMustHaveAnInput from test cases
* check for blst_ringct::Error::TransactionMustHaveAnInput
  • Loading branch information
dan-da committed Feb 23, 2022
1 parent d45477c commit e0a814e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
6 changes: 4 additions & 2 deletions src/dbc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ pub(crate) mod tests {

assert!(matches!(
dbc.confirm_valid(&owner_once.owner_base().secret_key()?, &mint_key_manager),
Err(Error::TransactionMustHaveAnInput)
Err(Error::RingCt(
blst_ringct::Error::TransactionMustHaveAnInput
))
));

Ok(())
Expand Down Expand Up @@ -634,7 +636,7 @@ pub(crate) mod tests {
.iter()
.any(|o| *o.public_key() == dbc_owner));
}
Err(Error::TransactionMustHaveAnInput) => {
Err(Error::RingCt(blst_ringct::Error::TransactionMustHaveAnInput)) => {
assert_eq!(n_inputs.coerce::<u8>(), 0);
}
Err(Error::FailedSignature) => {
Expand Down
3 changes: 0 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ pub enum Error {
#[error("Transaction hash does not match the transaction signed by spentbook")]
InvalidTransactionHash,

#[error("The DBC transaction must have at least one input")]
TransactionMustHaveAnInput,

#[error("Dbc Content is not a member of transaction outputs")]
DbcContentNotPresentInTransactionOutput,

Expand Down
2 changes: 1 addition & 1 deletion src/mint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ mod tests {
Error::RingCt(blst_ringct::Error::InvalidHiddenCommitmentInRing) => {
assert!(!invalid_spent_proofs.is_empty());
}
Error::TransactionMustHaveAnInput => {
Error::RingCt(blst_ringct::Error::TransactionMustHaveAnInput) => {
assert_eq!(input_amounts.len(), 0);
}
Error::FailedSignature => {
Expand Down

0 comments on commit e0a814e

Please sign in to comment.