1. 把 validateMe 分解成 静态数据检查(给客户端调用)validateMe 和 动态可执行性检查(给链节点调用)executableMe.

2. 在 Action.api.prepare() 里,生成可运行的对象 typedAction 存入 ActionPool,而不是仅仅存数据 option.Action进去。
3. 删除 Action.getJson(),把 DAD.verifyXxx(action) 都改为 MOM.verifyXxx().
4. 添加了 ActionRegisterChain.js 作为 应用链注册事务。
This commit is contained in:
luk.lu
2019-04-11 15:59:26 +08:00
committed by luk.lu
parent 044c2175d6
commit a289a4b2ad
5 changed files with 129 additions and 55 deletions

View File

@@ -9,11 +9,15 @@ DAD.__proto__ = Action
const MOM = DAD.prototype
MOM.__proto__ = Action.prototype
MOM.validateMe = async function () {
MOM.validateMe = function () {
// if (sender && sender.type !== 'multisig' && action.toAddress != action.actorAddress && sender.balance >= action.amount + action.fee){
let balance = await wo.Store.getBalance(this.actorAddress)
return this.actorAddress && this.toAddress && this.toAddress != this.actorAddress
&& this.amount && this.amount > 0 && this.fee >= wo.Config.MIN_FEE_ActionTransfer && balance >= this.amount + this.fee
&& this.amount && this.amount > 0 && (this.fee >= wo.Config.MIN_FEE_ActionTransfer || 0)
}
MOM.executableMe = async function() {
let balance = await wo.Store.getBalance(this.actorAddress)
return balance >= this.amount + this.fee
}
MOM.executeMe = async function () {