From e6ae650f7acd399c59387646ad2d4bbac1d0017a Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Thu, 27 Feb 2020 16:08:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=20Action.js=20=E9=87=8C?= =?UTF-8?q?=E5=AF=B9=20ActionXxx=20=E7=9A=84=E5=BC=95=E5=85=A5=EF=BC=8C?= =?UTF-8?q?=E8=BF=99=E6=A0=B7=E8=BF=98=E6=98=AF=E4=BC=9A=E9=80=A0=E6=88=90?= =?UTF-8?q?=E5=BE=AA=E7=8E=AF=E5=BC=95=E5=85=A5=E7=9A=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Action.js | 3 +-- index.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Action.js b/Action.js index 18650de..ded3ef1 100644 --- a/Action.js +++ b/Action.js @@ -1,6 +1,5 @@ const Ling = require('so.ling') const ticCrypto = require('tic.crypto') -const wo = require('./index.js') // 许多地方需要 wo[type] /** ****************** Public of instance ********************/ @@ -84,7 +83,7 @@ DAD.verifyHash = function (actionData) { DAD.build = async function (action, keypair) { // Applicable on client. 客户端调用 Action.build,即可新建、并打包成一个完整的子事务,不需要亲自调用 constructor, packMe 等方法。 if (action && action.type && keypair && keypair.seckey && keypair.pubkey) { - let typedAction = new wo[action.type](action) + let typedAction = new require(`./${action.type}`)(action) if (typedAction.validateMe()) { await typedAction.packMe(keypair) return typedAction diff --git a/index.js b/index.js index 06fe1d8..8484037 100644 --- a/index.js +++ b/index.js @@ -3,7 +3,7 @@ const ActionTransfer = require('./ActionTransfer.js') const ActionStore = require('./ActionStore.js') const ActionMultisig = require('./ActionMultisig.js') const ActionLockProof = require('./ActionLockProof.js') -const ActionTac = require('./ActionTac.js') +// const ActionTac = require('./ActionTac.js') module.exports = { // Action,