bufferutils: add varIntBuffer

This commit is contained in:
Daniel Cousens 2014-10-17 13:07:14 +11:00
parent c0c47f076a
commit 2214ccfdd8
4 changed files with 22 additions and 10 deletions

View file

@ -88,6 +88,16 @@ describe('bufferutils', function() {
})
})
describe('varIntBuffer', function() {
fixtures.valid.forEach(function(f) {
it('encodes ' + f.dec + ' correctly', function() {
var buffer = bufferutils.varIntBuffer(f.dec)
assert.equal(buffer.toString('hex'), f.hexVI)
})
})
})
describe('varIntSize', function() {
fixtures.valid.forEach(function(f) {
it('determines the varIntSize of ' + f.dec + ' correctly', function() {
@ -99,7 +109,7 @@ describe('bufferutils', function() {
})
describe('writePushDataInt', function() {
fixtures.valid.forEach(function(f, i) {
fixtures.valid.forEach(function(f) {
if (!f.hexPD) return
it('encodes ' + f.dec + ' correctly', function() {