Add weight and ability to get strippedsize
This commit is contained in:
parent
29e319525f
commit
48bf08c0d3
5 changed files with 28 additions and 6 deletions
test
|
@ -48,6 +48,11 @@ describe('Block', () => {
|
|||
assert.strictEqual(block.bits, f.bits);
|
||||
assert.strictEqual(block.nonce, f.nonce);
|
||||
assert.strictEqual(!block.transactions, f.hex.length === 160);
|
||||
if (f.size && f.strippedSize && f.weight) {
|
||||
assert.strictEqual(block.byteLength(false, true), f.size);
|
||||
assert.strictEqual(block.byteLength(false, false), f.strippedSize);
|
||||
assert.strictEqual(block.weight(), f.weight);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
5
test/fixtures/block.json
vendored
5
test/fixtures/block.json
vendored
|
@ -133,7 +133,10 @@
|
|||
"prevHash": "8980ebb11236bacc66c447d5ad961bc546c0f9cc385a08000000000000000000",
|
||||
"timestamp": 1537429727,
|
||||
"valid": true,
|
||||
"version": 536870912
|
||||
"version": 536870912,
|
||||
"size": 2355,
|
||||
"strippedSize": 2209,
|
||||
"weight": 8982
|
||||
}
|
||||
],
|
||||
"invalid": [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue