feat: add weight method on transaction type

This commit is contained in:
thunderbiscuit committed 2024-04-29 09:20:31 -04:00
1 parent e1a93379ce
commit eff4abcbfb
2 files changed
+5 -3

No files matched your search

+2
View File
@@ -526,6 +526,8 @@ interface Transaction {
i32 version(); i32 version();
sequence<u8> serialize(); sequence<u8> serialize();
u64 weight();
}; };
interface Psbt { interface Psbt {
+3 -3
View File
@@ -129,9 +129,9 @@ impl Transaction {
self.inner.txid().to_string() self.inner.txid().to_string()
} }
// fn weight(&self) -> u64 { pub fn weight(&self) -> u64 {
// self.inner.weight() as u64 self.inner.weight().to_wu()
// } }
pub fn total_size(&self) -> u64 { pub fn total_size(&self) -> u64 {
self.inner.total_size() as u64 self.inner.total_size() as u64