Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ impl AuthorizedPublicKeySpend {
pub fn new(signature: Signature) -> Self {
Self { signature }
}

pub fn signature(&self) -> &Signature {
&self.signature
}
}

pub fn verify_public_key_spending(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct AuthorizedPublicKeyHashSpend {
impl AuthorizedPublicKeyHashSpend {
pub fn from_data<T: AsRef<[u8]>>(data: T) -> Result<Self, DestinationSigError> {
let decoded = AuthorizedPublicKeyHashSpend::decode_all(&mut data.as_ref())
.map_err(|e| DestinationSigError::AddressAuthDecodingFailed(e.to_string()))?;
.map_err(DestinationSigError::AddressAuthDecodingFailed)?;
Ok(decoded)
}

Expand All @@ -39,6 +39,10 @@ impl AuthorizedPublicKeyHashSpend {
signature,
}
}

pub fn signature(&self) -> &Signature {
&self.signature
}
}

pub fn verify_public_key_hash_spending(
Expand Down
4 changes: 2 additions & 2 deletions common/src/chain/transaction/signature/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ pub enum DestinationSigError {
SignatureVerificationFailed,
#[error("Public key to public key hash mismatch")]
PublicKeyToHashMismatch,
#[error("Address authorization decoding failed")]
AddressAuthDecodingFailed(String),
#[error("Address authorization decoding failed: {0}")]
AddressAuthDecodingFailed(serialization::Error),
#[error("Signature decoding failed")]
InvalidSignatureEncoding,
#[error("No signature!")]
Expand Down
1 change: 1 addition & 0 deletions wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ chainstate-test-framework = { path = "../chainstate/test-framework" }
test-utils = { path = "../test-utils" }

ctor.workspace = true
lazy_static.workspace = true
rstest.workspace = true
serde_json.workspace = true
serial_test.workspace = true
Expand Down
2 changes: 2 additions & 0 deletions wallet/src/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ pub enum SignerError {
AddressError(#[from] AddressError),
#[error("Order was filled more than the available balance")]
OrderFillUnderflow,
#[error("Multisig HTLC destination expected")]
HtlcMultisigDestinationExpected,
}

type SignerResult<T> = Result<T, SignerError>;
Expand Down
13 changes: 12 additions & 1 deletion wallet/src/signer/software_signer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ use rstest::rstest;
use test_utils::random::{make_seedable_rng, Seed};

use crate::signer::tests::{
generic_fixed_signature_tests::test_fixed_signatures_generic,
generic_fixed_signature_tests::{
test_fixed_signatures_generic, test_fixed_signatures_generic2,
},
generic_tests::{
test_sign_message_generic, test_sign_transaction_generic,
test_sign_transaction_intent_generic,
Expand Down Expand Up @@ -61,3 +63,12 @@ fn test_fixed_signatures(#[case] seed: Seed) {

test_fixed_signatures_generic(&mut rng, make_deterministic_software_signer);
}

#[rstest]
#[trace]
#[case(Seed::from_entropy())]
fn test_fixed_signatures2(#[case] seed: Seed) {
let mut rng = make_seedable_rng(seed);

test_fixed_signatures_generic2(&mut rng, make_deterministic_software_signer);
}
Loading