-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
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 Report
@@ 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
|
* 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 |
There was a problem hiding this comment.
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.
…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
c9e0eb6
to
ca8f790
Compare
*/ | ||
console.log(myAddressObj.value) | ||
// console.log(`Public key hash: ${publicKeyHash}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless annotation?
There was a problem hiding this comment.
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], |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
remove the address module and expose the addresses via new-introduced key pair module
BREAKING CHANGE: remove address module and add key pair module