feat: add weight method on transaction type

This commit is contained in:
thunderbiscuit 2024-04-19 09:25:20 -04:00
parent e1a93379ce
commit eff4abcbfb
No known key found for this signature in database
GPG Key ID: 88253696EB836462
2 changed files with 5 additions and 3 deletions

View File

@ -526,6 +526,8 @@ interface Transaction {
i32 version();
sequence<u8> serialize();
u64 weight();
};
interface Psbt {

View File

@ -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