diff --git a/src/base58check.js b/src/base58check.js new file mode 100644 index 0000000..2e91a43 --- /dev/null +++ b/src/base58check.js @@ -0,0 +1,18 @@ +var bs58check = require('bs58check') + +function decode() { + console.warn('bs58check will be removed in 2.0.0. require("bs58check") instead.'); + + bs58check.decode.apply(undefined, arguments) +} + +function encode() { + console.warn('bs58check will be removed in 2.0.0. require("bs58check") instead.'); + + bs58check.encode.apply(undefined, arguments) +} + +module.exports = { + decode: decode, + encode: encode +} diff --git a/src/index.js b/src/index.js index 9be80f6..85f0631 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ module.exports = { Address: require('./address'), - base58check: require('bs58check'), + base58check: require('./bs58check'), bufferutils: require('./bufferutils'), crypto: require('./crypto'), ecdsa: require('./ecdsa'), diff --git a/test/base58check.js b/test/base58check.js new file mode 100644 index 0000000..09e9378 --- /dev/null +++ b/test/base58check.js @@ -0,0 +1,25 @@ +var base58check = require('../src/base58check') +var bs58check = require('bs58check') +var sinon = require('sinon') + +describe('base58check', function() { + var param + + beforeEach(function() { + param = {} + }) + + it('wraps bs58check.decode', sinon.test(function() { + this.mock(bs58check).expects('decode') + .once().calledWith(param) + + base58check.decode(param) + })) + + it('wraps bs58check.encode', sinon.test(function() { + this.mock(bs58check).expects('encode') + .once().calledWith(param) + + base58check.encode(param) + })) +})