stellar-base
Advanced tools
Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "stellar-base", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"private": false, | ||
@@ -9,2 +9,2 @@ "main": "dist/stellar-base.js", | ||
"ignore": [] | ||
} | ||
} |
@@ -60,3 +60,7 @@ 'use strict'; | ||
.pipe(gulp.dest('dist')) | ||
.pipe(plugins.uglify()) | ||
.pipe(plugins.uglify({ | ||
output: { | ||
ascii_only: true | ||
} | ||
})) | ||
.pipe(plugins.rename('stellar-base.min.js')) | ||
@@ -97,2 +101,2 @@ .pipe(gulp.dest('dist')); | ||
.pipe(plugins.coveralls()); | ||
}); | ||
}); |
@@ -11,3 +11,3 @@ "use strict"; | ||
var decodeBase58Check = require("./index").decodeBase58Check; | ||
var decodeBase58Check = require("./base58.js").decodeBase58Check; | ||
@@ -14,0 +14,0 @@ /** |
@@ -56,2 +56,6 @@ "use strict"; | ||
if (versionByteName === "accountId" && decoded.length !== 37) { | ||
throw new Error("Decoded address length is invalid. Expected 37, got " + decoded.length); | ||
} | ||
return new Buffer(data); | ||
@@ -58,0 +62,0 @@ } |
{ | ||
"name": "stellar-base", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Low level stellar support library", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "gulp test" | ||
"test": "gulp test", | ||
"docs": "./node_modules/.bin/jsdoc ./src/ -d docs/" | ||
}, | ||
@@ -9,0 +10,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
import {decodeBase58Check} from "./index"; | ||
import {decodeBase58Check} from "./base58"; | ||
@@ -3,0 +3,0 @@ /** |
@@ -41,2 +41,6 @@ import {default as bs58} from "./vendor/bs58"; | ||
if (versionByteName === 'accountId' && decoded.length !== 37) { | ||
throw new Error(`Decoded address length is invalid. Expected 37, got ${decoded.length}`); | ||
} | ||
return new Buffer(data); | ||
@@ -43,0 +47,0 @@ } |
@@ -41,6 +41,7 @@ | ||
let unencoded = "hello world"; | ||
let unencodedBuffer = new Buffer(unencoded, 'utf8'); | ||
let accountIdEncoded = "gpvQBfBaMiGQZ2xUqW9KNR"; | ||
let seedEncoded = "n3GdokGwy1qJ11qLmsTzoL"; | ||
var keypair = StellarBase.Keypair.master(); | ||
let unencodedBuffer = keypair.publicKey(); | ||
let unencoded = unencodedBuffer.toString(); | ||
let accountIdEncoded = keypair.address(); | ||
let seedEncoded = StellarBase.encodeBase58Check("seed", unencodedBuffer); | ||
@@ -50,4 +51,4 @@ describe('StellarBase#decodeBase58Check', function() { | ||
it("decodes correctly", function() { | ||
expectBuffersToBeEqual(StellarBase.decodeBase58Check("accountId", "gpvQBfBaMiGQZ2xUqW9KNR"), unencodedBuffer); | ||
expectBuffersToBeEqual(StellarBase.decodeBase58Check("seed", "n3GdokGwy1qJ11qLmsTzoL"), unencodedBuffer); | ||
expectBuffersToBeEqual(StellarBase.decodeBase58Check("accountId", accountIdEncoded), unencodedBuffer); | ||
expectBuffersToBeEqual(StellarBase.decodeBase58Check("seed", seedEncoded), unencodedBuffer); | ||
}); | ||
@@ -74,7 +75,2 @@ | ||
it("encodes a string correctly", function() { | ||
expect(StellarBase.encodeBase58Check("accountId", unencoded)).to.eql(accountIdEncoded); | ||
expect(StellarBase.encodeBase58Check("seed", unencoded)).to.eql(seedEncoded); | ||
}); | ||
it("encodes a buffer correctly", function() { | ||
@@ -81,0 +77,0 @@ expect(StellarBase.encodeBase58Check("accountId", unencodedBuffer)).to.eql(accountIdEncoded); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
1557620
81
34431