去掉 Action.js 里对 ActionXxx 的引入,这样还是会造成循环引入的。
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user