Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(core): remove address module #369

Merged
merged 4 commits into from
Oct 15, 2019
Merged

feat(core): remove address module #369

merged 4 commits into from
Oct 15, 2019

Conversation

Keith-CY
Copy link
Member

remove the address module and expose the addresses via new-introduced key pair module

BREAKING CHANGE: remove address module and add key pair module

remove the address module and expose the addresses via new-introduced key pair module

BREAKING CHANGE: remove address module and add key pair module
@codecov-io
Copy link

codecov-io commented Oct 14, 2019

Codecov Report

Merging #369 into develop will decrease coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #369      +/-   ##
===========================================
- Coverage    99.62%   99.62%   -0.01%     
===========================================
  Files           16       15       -1     
  Lines          533      527       -6     
  Branches       147      142       -5     
===========================================
- Hits           531      525       -6     
  Misses           1        1              
  Partials         1        1
Impacted Files Coverage Δ
packages/ckb-sdk-utils/src/index.ts 100% <100%> (ø) ⬆️

* genereat address object, who has peroperties like private key, public key, sign method and verify mehtod
* - value, the address string
* genereat key pair object, who has peroperties as private key, public key, mainnet address, testnet address, sign method and verify mehtod
* - mainnetAddress, the address string for the Mainnet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still mixing address with keys. Key pair should have single responsibility of holding private and public key and provide secp256k1 signing. It has nothing to do with addresses.

@Keith-CY Keith-CY changed the title feat(core): remove address module and add key pair module feat(core): remove address module Oct 14, 2019
…ses from private keys

add a method of core.utils.privateKeytoPublicKey
add a method of core.utils.privateKeyToAddress

BREAKING CHANGE: KeyPair from the core module
*/
console.log(myAddressObj.value)
// console.log(`Public key hash: ${publicKeyHash}`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless annotation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's for someone who is unfamiliar with JavaScript.

@@ -35,7 +46,7 @@ const bootstrap = async () => {
const lockScript = {
hashType: "type",
codeHash: blockAssemblerCodeHash,
args: [myAddressObj.publicKeyHash],
args: [publicKeyHash],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now args is a Bytes not an array?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now args is a Bytes not an array?

fixed in 9bcec6b

@Keith-CY Keith-CY merged commit e467427 into develop Oct 15, 2019
@Keith-CY Keith-CY deleted the refactor-addresses branch October 15, 2019 08:24
@Keith-CY Keith-CY mentioned this pull request Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants