refactor: use assert.strictEqual instead of assert.equal.
This commit is contained in:
parent
8146fb28f0
commit
8f73ec53e9
@ -10,7 +10,7 @@ HD.fromMnemonic(mnemonic);
|
||||
|
||||
const phrase = mnemonic.getPhrase();
|
||||
|
||||
assert.equal(Mnemonic.fromPhrase(phrase).getPhrase(), phrase);
|
||||
assert.strictEqual(Mnemonic.fromPhrase(phrase).getPhrase(), phrase);
|
||||
|
||||
{
|
||||
const end = bench('fromPhrase');
|
||||
|
||||
@ -295,13 +295,13 @@ BlockTemplate.prototype.createCoinbase = function createCoinbase(hash) {
|
||||
// CB size = 208
|
||||
// Sigops cost = 4
|
||||
if (!this.witness) {
|
||||
assert.equal(cb.getWeight() + padding * scale, 500);
|
||||
assert.equal(cb.getBaseSize() + padding, 125);
|
||||
assert.equal(cb.getSize() + padding, 125);
|
||||
assert.strictEqual(cb.getWeight() + padding * scale, 500);
|
||||
assert.strictEqual(cb.getBaseSize() + padding, 125);
|
||||
assert.strictEqual(cb.getSize() + padding, 125);
|
||||
} else {
|
||||
assert.equal(cb.getWeight() + padding * scale, 724);
|
||||
assert.equal(cb.getBaseSize() + padding, 172);
|
||||
assert.equal(cb.getSize() + padding, 208);
|
||||
assert.strictEqual(cb.getWeight() + padding * scale, 724);
|
||||
assert.strictEqual(cb.getBaseSize() + padding, 172);
|
||||
assert.strictEqual(cb.getSize() + padding, 208);
|
||||
}
|
||||
|
||||
// Setup coinbase flags (variable size).
|
||||
|
||||
@ -677,7 +677,7 @@ BIP151.prototype.read = function read(size) {
|
||||
off += len;
|
||||
}
|
||||
|
||||
assert.equal(off, chunk.length);
|
||||
assert.strictEqual(off, chunk.length);
|
||||
|
||||
this.total -= chunk.length;
|
||||
|
||||
|
||||
@ -817,7 +817,7 @@ HostList.prototype.toArray = function toArray() {
|
||||
for (const entry of this.map.values())
|
||||
out.push(entry.addr);
|
||||
|
||||
assert.equal(out.length, this.size());
|
||||
assert.strictEqual(out.length, this.size());
|
||||
|
||||
return out;
|
||||
};
|
||||
|
||||
@ -75,7 +75,7 @@ Parser.prototype.feed = function feed(data) {
|
||||
off += len;
|
||||
}
|
||||
|
||||
assert.equal(off, chunk.length);
|
||||
assert.strictEqual(off, chunk.length);
|
||||
|
||||
this.total -= chunk.length;
|
||||
this.parse(chunk);
|
||||
|
||||
@ -1228,11 +1228,11 @@ MTX.prototype.fund = async function fund(coins, options) {
|
||||
if (change.isDust(policy.MIN_RELAY)) {
|
||||
// Do nothing. Change is added to fee.
|
||||
this.changeIndex = -1;
|
||||
assert.equal(this.getFee(), select.fee + select.change);
|
||||
assert.strictEqual(this.getFee(), select.fee + select.change);
|
||||
} else {
|
||||
this.outputs.push(change);
|
||||
this.changeIndex = this.outputs.length - 1;
|
||||
assert.equal(this.getFee(), select.fee);
|
||||
assert.strictEqual(this.getFee(), select.fee);
|
||||
}
|
||||
|
||||
return select;
|
||||
|
||||
@ -387,7 +387,7 @@ IP.parseV6 = function parseV6(str, raw, offset) {
|
||||
}
|
||||
|
||||
assert(missing === 0, 'IPv6 address has missing sections.');
|
||||
assert.equal(offset, start + 16);
|
||||
assert.strictEqual(offset, start + 16);
|
||||
|
||||
return raw;
|
||||
};
|
||||
|
||||
@ -75,7 +75,7 @@ Parser.prototype.read = function read(size) {
|
||||
off += len;
|
||||
}
|
||||
|
||||
assert.equal(off, chunk.length);
|
||||
assert.strictEqual(off, chunk.length);
|
||||
|
||||
this.total -= chunk.length;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user