Skip to content

Commit

Permalink
run clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Aug 14, 2024
1 parent 83391a6 commit 5505aa4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ mod tests {
};
assert!(key
.public_key()
.verify(&sig_hash.as_ref(), &signature.signature));
.verify(sig_hash.as_ref(), &signature.signature));
}
}
}
19 changes: 11 additions & 8 deletions src/transactionbuilder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,16 @@ pub struct ToSign {
/// - Add ArbitraryData
/// - Add Signature

impl Default for TransactionBuilder {
fn default() -> Self {
Self::new()
}
}

impl TransactionBuilder {
/// Creates a new transaction builder
pub fn new() -> TransactionBuilder {
TransactionBuilder {
transaction: Default::default(),
}
Default::default()
}

pub fn add_change_address(self, _address: Address) -> Self {
Expand All @@ -65,7 +69,7 @@ impl TransactionBuilder {
/// condition
pub fn add_siacoin_input(mut self, parent_id: SiacoinOutputID, public_key: UnlockKey) -> Self {
self.transaction.siacoin_inputs.push(SiacoinInput {
parent_id: parent_id,
parent_id,
unlock_conditions: UnlockConditions {
public_keys: vec![public_key],
timelock: 0,
Expand All @@ -77,10 +81,9 @@ impl TransactionBuilder {

/// Adds a siacoin output with the given value to the transaction
pub fn add_siacoin_output(mut self, address: Address, value: Currency) -> Self {
self.transaction.siacoin_outputs.push(SiacoinOutput {
address: address,
value: value,
});
self.transaction
.siacoin_outputs
.push(SiacoinOutput { address, value });
self
}

Expand Down

0 comments on commit 5505aa4

Please sign in to comment.