Skip to content

Commit

Permalink
Fix DNSSEC real-records test
Browse files Browse the repository at this point in the history
  • Loading branch information
Arachnid committed May 14, 2021
1 parent 8abae5e commit 9b23df9
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions test/TestDNSSEC.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,13 @@ contract('DNSSEC', accounts => {
var instance = await dnssec.deployed();
var proof = await instance.anchors();
const totalLen = test_rrsets.map(([name, rrset, sig]) => (rrset.length / 2 - 1) + (sig.length / 2 - 1) + 4).reduce((a,b) => a+b);
const buf = Buffer.alloc(totalLen);
let off = 0;
const sets = [];
for (const [name, rrset, sig] of test_rrsets) {
const rrsetBuf = Buffer.from(rrset.slice(2), 'hex');
const sigBuf = Buffer.from(sig.slice(2), 'hex');
buf.writeUInt16BE(rrsetBuf.length, off);
off += 2;
rrsetBuf.copy(buf, off);
off += rrsetBuf.length;
buf.writeUInt16BE(sigBuf.length, off);
off += 2;
sigBuf.copy(buf, off);
off += sigBuf.length;
sets.push([rrsetBuf, sigBuf]);
}
var tx = await instance.submitRRSets(buf, proof);
var tx = await instance.submitRRSets(sets, proof);
assert.equal(tx.receipt.status, true);
});
});
Expand Down

0 comments on commit 9b23df9

Please sign in to comment.