refactor: use assert.strictEqual instead of assert.equal.

This commit is contained in:
Christopher Jeffrey 2017-08-09 15:40:39 -07:00
parent 8146fb28f0
commit 8f73ec53e9
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD
8 changed files with 14 additions and 14 deletions

View File

@ -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');

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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