feat: add weight method on transaction type
This commit is contained in:
parent
e1a93379ce
commit
eff4abcbfb
@ -526,6 +526,8 @@ interface Transaction {
|
||||
i32 version();
|
||||
|
||||
sequence<u8> serialize();
|
||||
|
||||
u64 weight();
|
||||
};
|
||||
|
||||
interface Psbt {
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user