Add weight, size, and vsize methods on the Transaction type
This commit is contained in:
parent
d48bacd29b
commit
1e9ecfbe52
@ -248,6 +248,12 @@ interface Transaction {
|
||||
constructor(sequence<u8> transaction_bytes);
|
||||
|
||||
sequence<u8> serialize();
|
||||
|
||||
u64 weight();
|
||||
|
||||
u64 size();
|
||||
|
||||
u64 vsize();
|
||||
};
|
||||
|
||||
interface PartiallySignedTransaction {
|
||||
|
@ -254,6 +254,18 @@ impl Transaction {
|
||||
fn serialize(&self) -> Vec<u8> {
|
||||
self.internal.serialize()
|
||||
}
|
||||
|
||||
fn weight(&self) -> u64 {
|
||||
self.internal.weight() as u64
|
||||
}
|
||||
|
||||
fn size(&self) -> u64 {
|
||||
self.internal.size() as u64
|
||||
}
|
||||
|
||||
fn vsize(&self) -> u64 {
|
||||
self.internal.vsize() as u64
|
||||
}
|
||||
}
|
||||
|
||||
/// A Bitcoin address.
|
||||
|
Loading…
x
Reference in New Issue
Block a user