Fixes import & export with new encryption

This commit is contained in:
Esteban Ordano 2014-10-28 00:31:30 -03:00
commit 35bab383b0
12 changed files with 86 additions and 67 deletions

View file

@ -249,7 +249,7 @@ describe('Identity model', function() {
var fakeCrypto = {
kdf: sinon.stub().returns('passphrase'),
decrypt: sinon.stub().returns({walletId:123}),
decrypt: sinon.stub().returns('{"walletId":123}'),
};
var opts = {
@ -258,7 +258,7 @@ describe('Identity model', function() {
};
Identity.create(args.params, function(err, iden) {
iden.importWallet(123,'password', opts, function(err){
iden.importEncryptedWallet(123,'password', opts, function(err){
should.not.exist(err);
fakeCrypto.kdf.getCall(0).args[0].should.equal('password');
fakeCrypto.decrypt.getCall(0).args[0].should.equal('passphrase');