-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #351 from nervosnetwork/rc/v0.21.0
[ᚬmaster] Rc/v0.21.0
- Loading branch information
Showing
62 changed files
with
3,137 additions
and
2,529 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
"packages": [ | ||
"packages/*" | ||
], | ||
"version": "0.20.0" | ||
"version": "0.21.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@nervosnetwork/ckb-cli", | ||
"version": "0.20.0", | ||
"version": "0.21.0", | ||
"description": "Command line package based on @nervosnetwork/ckb-sdk-core", | ||
"author": "Nervos <[email protected]>", | ||
"homepage": "https://github.com/nervosnetwork/ckb-sdk-js#readme", | ||
|
@@ -34,15 +34,15 @@ | |
"url": "https://github.com/nervosnetwork/ckb-sdk-js/issues" | ||
}, | ||
"dependencies": { | ||
"@nervosnetwork/ckb-sdk-core": "0.20.0", | ||
"@nervosnetwork/ckb-sdk-core": "0.21.0", | ||
"blessed": "0.1.81", | ||
"blessed-contrib": "4.8.16", | ||
"commander": "2.20.0", | ||
"inquirer": "6.2.1" | ||
"inquirer": "6.5.2" | ||
}, | ||
"devDependencies": { | ||
"@types/blessed": "0.1.12", | ||
"@types/inquirer": "6.5.0" | ||
}, | ||
"gitHead": "478433630dd40501f1f67dc259bf9d252c56fcd3" | ||
"gitHead": "5a1aaff6006c91e45e8ba39ceb6ef7c2f870e6cd" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 0 additions & 59 deletions
59
packages/ckb-sdk-address/__tests__/ckb-sdk-address.test.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"generateAddress": { | ||
"with default configuration": { | ||
"privateKey": "0xe79f3207ea4980b7fed79956d5934249ceac4751a4fae01a0f7c4a96884bc4e3", | ||
"expected": { | ||
"publicKeyHash": "0x36c329ed630d6ce750712a477543672adab57f4c", | ||
"address": "ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqswmu83" | ||
} | ||
}, | ||
"with specified prefix": { | ||
"privateKey": "0xe79f3207ea4980b7fed79956d5934249ceac4751a4fae01a0f7c4a96884bc4e3", | ||
"prefix": "ckt", | ||
"expected": { | ||
"publicKeyHash": "0x36c329ed630d6ce750712a477543672adab57f4c", | ||
"address": "ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqswmu83" | ||
} | ||
}, | ||
"with specified type of 0x01": { | ||
"privateKey": "0xe79f3207ea4980b7fed79956d5934249ceac4751a4fae01a0f7c4a96884bc4e3", | ||
"type": "0x01", | ||
"expected": { | ||
"publicKeyHash": "0x36c329ed630d6ce750712a477543672adab57f4c", | ||
"address": "ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqswmu83" | ||
} | ||
}, | ||
"with specified type of 0x01 and code hash of 0x00": { | ||
"privateKey": "0xe79f3207ea4980b7fed79956d5934249ceac4751a4fae01a0f7c4a96884bc4e3", | ||
"type": "0x01", | ||
"codeHashIndex": "0x00", | ||
"expected": { | ||
"publicKeyHash": "0x36c329ed630d6ce750712a477543672adab57f4c", | ||
"address": "ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqswmu83" | ||
} | ||
}, | ||
"with private key in bytes format": { | ||
"privateKey": [ | ||
231, | ||
159, | ||
50, | ||
7, | ||
234, | ||
73, | ||
128, | ||
183, | ||
254, | ||
215, | ||
153, | ||
86, | ||
213, | ||
147, | ||
66, | ||
73, | ||
206, | ||
172, | ||
71, | ||
81, | ||
164, | ||
250, | ||
224, | ||
26, | ||
15, | ||
124, | ||
74, | ||
150, | ||
136, | ||
75, | ||
196, | ||
227 | ||
], | ||
"expected": { | ||
"publicKeyHash": "0x36c329ed630d6ce750712a477543672adab57f4c", | ||
"address": "ckt1qyqrdsefa43s6m882pcj53m4gdnj4k440axqswmu83" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
const { default: Address } = require('../lib') | ||
const { generateAddress: generateAddressFixtures } = require('./fixtures.json') | ||
|
||
describe('ckb-sdk-address', () => { | ||
describe('generate address', () => { | ||
const fixtureTable = Object.entries(generateAddressFixtures).map( | ||
([title, { privateKey, expected, exception, ...config }]) => [title, privateKey, config, expected, exception] | ||
) | ||
|
||
test.each(fixtureTable)('%s', (_title, privateKey, config, expected, exception) => { | ||
const option = Object.keys(config).length ? config : undefined | ||
if (undefined !== expected) { | ||
const address = new Address(privateKey, option) | ||
expect(address.publicKeyHash).toBe(expected.publicKeyHash) | ||
expect(address.value).toBe(expected.address) | ||
} | ||
if (undefined !== exception) { | ||
expect(() => new Address(privateKey, option)).toThrow(new Error(exception)) | ||
} | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.