From 187758e1da51e50b883c69715656715460ca7571 Mon Sep 17 00:00:00 2001 From: Fan Yinghao Date: Thu, 9 Aug 2018 11:34:26 +0800 Subject: [PATCH 1/2] add privateToPublic method --- src/keygen.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/keygen.js b/src/keygen.js index 7932eda..0888fa1 100644 --- a/src/keygen.js +++ b/src/keygen.js @@ -8,7 +8,8 @@ const validate = require('./validate') module.exports = { generateMasterKeys, authsByPath, - deriveKeys + deriveKeys, + privateToPublic } /** @@ -163,5 +164,13 @@ function deriveKeys(path, wifsByPath) { return newKeys } +/** + @private privateToPublic + method of https://github.com/EOSIO/eosjs-ecc#privatetopublic + @return {String} EOSKey +*/ +function privateToPublic(wif) { + return PrivateKey.privateToPublic(wif) +} From 50d5066d7c483b2ae25e058369e2af79d3c9b24c Mon Sep 17 00:00:00 2001 From: Fan Yinghao Date: Thu, 9 Aug 2018 13:51:19 +0800 Subject: [PATCH 2/2] fix refference bug --- src/keygen.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/keygen.js b/src/keygen.js index 0888fa1..0c40c1b 100644 --- a/src/keygen.js +++ b/src/keygen.js @@ -4,6 +4,7 @@ const assert = require('assert') const {PrivateKey} = require('eosjs-ecc') const validate = require('./validate') +const ecc = require('eosjs-ecc') module.exports = { generateMasterKeys, @@ -172,5 +173,5 @@ function deriveKeys(path, wifsByPath) { @return {String} EOSKey */ function privateToPublic(wif) { - return PrivateKey.privateToPublic(wif) + return ecc.privateToPublic(wif) }