From 4e2a4b35db7c041bec279fff0effb36cbe0d8aec Mon Sep 17 00:00:00 2001 From: Luk Lu Date: Mon, 10 Feb 2020 16:04:07 +0800 Subject: [PATCH] =?UTF-8?q?DAD.=5Ftable=20=E6=94=B9=E4=B8=BA=20MOM.=5Ftabl?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Action.js | 3 ++- ActionMultisig.js | 3 ++- ActionRegisterChain.js | 1 + ActionStore.js | 3 ++- ActionTransfer.js | 1 + package.json | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Action.js b/Action.js index 9eccf09..d4fdc60 100644 --- a/Action.js +++ b/Action.js @@ -9,11 +9,12 @@ const DAD = module.exports = function Action (prop) { this.type = this.constructor.name } DAD.__proto__ = Ling -DAD._table = DAD.name + const MOM = DAD.prototype MOM.__proto__ = Ling.prototype /** ****************** Shared by instances ********************/ +MOM._table = DAD.name MOM._tablekey = 'hash' MOM._model = { hash: { default: undefined, sqlite: 'TEXT UNIQUE', mysql: 'VARCHAR(64) PRIMARY KEY' }, // 不纳入签名和哈希 diff --git a/ActionMultisig.js b/ActionMultisig.js index 56bbefb..82c2f5f 100644 --- a/ActionMultisig.js +++ b/ActionMultisig.js @@ -8,9 +8,10 @@ const DAD = module.exports = function ActionMultisig (prop) { this.type = this.constructor.name } DAD.__proto__ = Action -// DAD._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名 + const MOM = DAD.prototype MOM.__proto__ = Action.prototype +// MOM._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名 MOM.signMe = function (seckey) { // 由前端调用,后台不该进行签名 let json = this.getJson({ exclude: ['hash', 'blockHash', 'actorSignature', 'json'] }) // 是前端用户发起事务时签字,这时候还不知道进入哪个区块,所以不能计入blockHash diff --git a/ActionRegisterChain.js b/ActionRegisterChain.js index caa0810..3929344 100644 --- a/ActionRegisterChain.js +++ b/ActionRegisterChain.js @@ -6,6 +6,7 @@ const DAD = module.exports = function ActionRegisterChain (prop) { this.type = this.constructor.name } DAD.__proto__ = Action + const MOM = DAD.prototype MOM.__proto__ = Action.prototype diff --git a/ActionStore.js b/ActionStore.js index 4907200..41e9035 100644 --- a/ActionStore.js +++ b/ActionStore.js @@ -8,9 +8,10 @@ const DAD = module.exports = function ActionStore (prop) { this.type = this.constructor.name } DAD.__proto__ = Action -// DAD._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名 + const MOM = DAD.prototype MOM.__proto__ = Action.prototype +// MOM._table=DAD.name // 注释掉,从而继承父类Action的数据库表格名 /** ****************** Shared by instances ********************/ diff --git a/ActionTransfer.js b/ActionTransfer.js index 98fb591..47248ff 100644 --- a/ActionTransfer.js +++ b/ActionTransfer.js @@ -6,6 +6,7 @@ const DAD = module.exports = function ActionTransfer (prop) { this.type = this.constructor.name } DAD.__proto__ = Action + const MOM = DAD.prototype MOM.__proto__ = Action.prototype diff --git a/package.json b/package.json index 05f5928..15bbdb3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "tic.action", "version": "0.1.0", "dependencies": { - "so.ling": "git+https://git.faronear.org/so/so.ling#20190714_release_passtoken", + "so.ling": "git+https://git.faronear.org/so/so.ling#20200210_MOM._table", "tic.crypto": "git+https://git.faronear.org/tic/tic.crypto#20190109_preview" }, "devDependencies": {},