Skip to content

Commit

Permalink
feat: add weight method on transaction type
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Apr 26, 2024
1 parent e609b57 commit 2c2667f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions bdk-ffi/src/bdk.udl
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ interface Transaction {
i32 version();

sequence<u8> serialize();

u64 weight();
};

interface Psbt {
Expand Down
6 changes: 3 additions & 3 deletions bdk-ffi/src/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ impl Transaction {
self.inner.txid().to_string()
}

// fn weight(&self) -> u64 {
// self.inner.weight() as u64
// }
pub fn weight(&self) -> u64 {
self.inner.weight().to_wu()
}

pub fn total_size(&self) -> u64 {
self.inner.total_size() as u64
Expand Down

0 comments on commit 2c2667f

Please sign in to comment.