New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jwallet-web-keystore

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jwallet-web-keystore - npm Package Compare versions

Comparing version

to
0.2.5

2

lib/Keystore.js

@@ -122,3 +122,3 @@ 'use strict';

if (account.name === accountName) {
if (account.accountName === accountName) {
return account;

@@ -125,0 +125,0 @@ }

{
"name": "jwallet-web-keystore",
"version": "0.2.4",
"version": "0.2.5",
"description": "Library for ethereum blockchain accounts management",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -8,2 +8,3 @@ const should = require('should')

const accountName = 'address account'
const anotherAccountName = 'another address account'
const updatedAccountName = 'updated address account'

@@ -117,5 +118,21 @@ const accountIdLength = 36

it('setAccountName() should return unchanged account if accountName is the same', function(done) {
const sameAccount = keystore.setAccountName(accountId, accountName)
sameAccount.id.should.be.equal(accountId)
sameAccount.accountName.should.be.equal(accountName)
done()
})
it('setAccountName() should throw error (account with this name exists)', function(done) {
const anotherAccountId = keystore.createAccount({
password,
accountName: anotherAccountName,
type: 'address',
privateKey: `0x${'1'.repeat(64)}`,
})
try {
keystore.setAccountName(accountId, accountName)
keystore.setAccountName(accountId, anotherAccountName)

@@ -169,3 +186,3 @@ done(new Error('Exception not thrown'))

decryptedAccounts.should.be.an.Array()
decryptedAccounts.length.should.be.equal(1)
decryptedAccounts.length.should.be.equal(2)
decryptedAccounts[0].accountName.should.be.equal(updatedAccountName)

@@ -172,0 +189,0 @@ decryptedAccounts[0].privateKey.should.be.equal(privateKeyAddressPair.privateKey)