diff --git a/src/commonPoW.js b/src/commonPoW.js deleted file mode 100644 index 03598029c..000000000 --- a/src/commonPoW.js +++ /dev/null @@ -1,36 +0,0 @@ -/* global NimiqPoW */ -/* global CONFIG */ -/* global Constants */ -/* global Errors */ - -/** @type {Promise?} */ -let __nimiqPoWLoaded = null; - -/** - * Singleton promise - * - * @returns {Promise} - */ -async function loadNimiqPow() { // eslint-disable-line no-unused-vars - // eslint-disable-next-line no-return-assign - return __nimiqPoWLoaded || (__nimiqPoWLoaded = new Promise(async resolve => { - // Load web assembly encryption library into browser (if supported) - await NimiqPoW.WasmHelper.doImport(); - - switch (CONFIG.NETWORK) { - case Constants.NETWORK.DEV: - NimiqPoW.GenesisConfig.dev(); - break; - case Constants.NETWORK.TEST: - NimiqPoW.GenesisConfig.test(); - break; - case Constants.NETWORK.MAIN: - NimiqPoW.GenesisConfig.main(); - break; - default: - throw new Errors.InvalidNetworkConfig(); - } - - resolve(); - })); -} diff --git a/src/request/sign-staking/SignStaking.js b/src/request/sign-staking/SignStaking.js index ebd373369..3fb3f370e 100644 --- a/src/request/sign-staking/SignStaking.js +++ b/src/request/sign-staking/SignStaking.js @@ -136,9 +136,7 @@ class SignStaking { return; } - const powPrivateKey = key.derivePrivateKey(request.keyPath); - - const privateKey = Nimiq.PrivateKey.deserialize(powPrivateKey.serialize()); + const privateKey = key.derivePrivateKey(request.keyPath); const keyPair = Nimiq.KeyPair.derive(privateKey); const results = request.transactions.map(transaction => { diff --git a/src/request/sign-transaction/SignTransaction.js b/src/request/sign-transaction/SignTransaction.js index abbbb250a..3a646b049 100644 --- a/src/request/sign-transaction/SignTransaction.js +++ b/src/request/sign-transaction/SignTransaction.js @@ -182,9 +182,7 @@ class SignTransaction { return; } - const powPrivateKey = key.derivePrivateKey(request.keyPath); - - const privateKey = Nimiq.PrivateKey.deserialize(powPrivateKey.serialize()); + const privateKey = key.derivePrivateKey(request.keyPath); const keyPair = Nimiq.KeyPair.derive(privateKey); /** @type {Nimiq.Transaction} */