Skip to content

Commit

Permalink
Merge pull request #455 from nervosnetwork/bump-deps
Browse files Browse the repository at this point in the history
chore: bump versions of deps
  • Loading branch information
Keith-CY committed Jul 15, 2020
2 parents c8a57ce + 71b2996 commit 7be2b9c
Show file tree
Hide file tree
Showing 4 changed files with 1,483 additions and 1,124 deletions.
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,25 @@
},
"devDependencies": {
"@cryptape/sdk-ts-config": "0.0.1",
"@types/node": "13.11.0",
"@typescript-eslint/eslint-plugin": "2.26.0",
"@typescript-eslint/parser": "2.26.0",
"commitizen": "4.0.3",
"cz-conventional-changelog": "3.1.0",
"eslint": "6.8.0",
"eslint-config-airbnb-base": "14.1.0",
"eslint-config-prettier": "6.10.1",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-jest": "23.8.2",
"eslint-plugin-prettier": "3.1.2",
"husky": "4.2.3",
"jest": "25.2.7",
"lerna": "3.20.2",
"lint-staged": "10.1.1",
"prettier": "2.0.2",
"@types/node": "14.0.23",
"@typescript-eslint/eslint-plugin": "3.6.1",
"@typescript-eslint/parser": "3.6.1",
"commitizen": "4.1.2",
"cz-conventional-changelog": "3.2.0",
"eslint": "7.4.0",
"eslint-config-airbnb-base": "14.2.0",
"eslint-config-prettier": "6.11.0",
"eslint-plugin-import": "2.22.0",
"eslint-plugin-jest": "23.18.0",
"eslint-plugin-prettier": "3.1.4",
"husky": "4.2.5",
"jest": "26.1.0",
"lerna": "3.22.1",
"lint-staged": "10.2.11",
"prettier": "2.0.5",
"rimraf": "3.0.2",
"typedoc": "0.17.3",
"typescript": "3.8.3"
"typedoc": "0.17.8",
"typescript": "3.9.6"
},
"config": {
"commitizen": {
Expand Down
30 changes: 15 additions & 15 deletions packages/ckb-sdk-utils/__tests__/utils/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@ describe('parse epoch', () => {
})

describe('blake', () => {
it('blake2b("") with personal', () => {
it('blake2b([]) with personal', () => {
const fixture = {
str: '',
message: new Uint8Array(),
digest: '44f4c69744d5f8c55d642062949dcae49bc4e7ef43d388c5a12f42b5633d163e',
}
const s = blake2b(32, null, null, PERSONAL)
s.update(Buffer.from(fixture.str, 'utf8'))
s.update(fixture.message)
const digest = s.digest('hex')
expect(digest).toBe(fixture.digest)
})

it('blake2b("The quick brown fox jumps over the lazy dog") with personal', () => {
it('blake2b(Buffer.from("The quick brown fox jumps over the lazy dog")) with personal', () => {
const fixture = {
str: 'The quick brown fox jumps over the lazy dog',
message: 'The quick brown fox jumps over the lazy dog',
digest: 'abfa2c08d62f6f567d088d6ba41d3bbbb9a45c241a8e3789ef39700060b5cee2',
}
const s = blake2b(32, null, null, PERSONAL)
s.update(Buffer.from(fixture.str, 'utf8'))
s.update(new Uint8Array(Buffer.from(fixture.message, 'utf8')))
const digest = s.digest('hex')
expect(digest).toBe(fixture.digest)
})
Expand All @@ -71,30 +71,30 @@ describe('blake', () => {
expect(() => {
blake2b(
outlen,
key ? Buffer.from(key, 'hex') : null,
salt ? Buffer.from(salt, 'hex') : null,
personal ? Buffer.from(personal, 'hex') : null,
key ? new Uint8Array(Buffer.from(key, 'hex')) : null,
salt ? new Uint8Array(Buffer.from(salt, 'hex')) : null,
personal ? new Uint8Array(Buffer.from(personal, 'hex')) : null,
)
}).toThrowError(`Expect outlen to be at least 16, but ${outlen} received`)
} else {
const s = blake2b(
outlen,
key ? Buffer.from(key, 'hex') : null,
salt ? Buffer.from(salt, 'hex') : null,
personal ? Buffer.from(personal, 'hex') : null,
key ? new Uint8Array(Buffer.from(key, 'hex')) : null,
salt ? new Uint8Array(Buffer.from(salt, 'hex')) : null,
personal ? new Uint8Array(Buffer.from(personal, 'hex')) : null,
)
s.update(Buffer.from(input, 'hex'))
s.update(new Uint8Array(Buffer.from(input, 'hex')))
const digest = s.digest('hex')
expect(digest).toBe(out)
}
})

it('blake160', () => {
const fixture = {
str: '024a501efd328e062c8675f2365970728c859c592beeefd6be8ead3d901330bc01',
message: '024a501efd328e062c8675f2365970728c859c592beeefd6be8ead3d901330bc01',
digest: '36c329ed630d6ce750712a477543672adab57f4c',
}
const digest = blake160(Buffer.from(fixture.str, 'hex'), 'hex')
const digest = blake160(new Uint8Array(Buffer.from(fixture.message, 'hex')), 'hex')
expect(digest).toBe(fixture.digest)
})
})
Expand Down
2 changes: 1 addition & 1 deletion packages/ckb-sdk-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@nervosnetwork/ckb-types": "0.33.0",
"blake2b-wasm": "2.1.0",
"elliptic": "6.5.3",
"jsbi": "3.1.2"
"jsbi": "3.1.3"
},
"devDependencies": {
"@types/bitcoinjs-lib": "5.0.0",
Expand Down
Loading

0 comments on commit 7be2b9c

Please sign in to comment.