重命名 ActTransfer 为 ActionTransfer;

删除 ling 目录,把 Action*.js 迁移到上级根目录。
This commit is contained in:
luk.lu 2019-04-09 09:06:33 +08:00
parent c18b412c1b
commit 73ca4df3db
3 changed files with 8 additions and 8 deletions

View File

@ -1,9 +1,9 @@
const Action = require('./Action.js')
const DAD = module.exports = function ActTransfer (prop) {
this._class = 'ActTransfer'
this.setProp(prop) // 没有定义 ActTransfer.prototype._model因此继承了上级Action.prototype._model因此通过this.setProp继承了上级Action定义的实例自有数据。另一个方案是调用 Action.call(this, prop)
this.type = 'ActTransfer'
const DAD = module.exports = function ActionTransfer (prop) {
this._class = 'ActionTransfer'
this.setProp(prop) // 没有定义 ActionTransfer.prototype._model因此继承了上级Action.prototype._model因此通过this.setProp继承了上级Action定义的实例自有数据。另一个方案是调用 Action.call(this, prop)
this.type = 'ActionTransfer'
}
DAD.__proto__ = Action
const MOM = DAD.prototype
@ -12,7 +12,7 @@ MOM.__proto__ = Action.prototype
DAD.validate = async function (action) {
// if (sender && sender.type !== 'multisig' && action.toAddress != action.actorAddress && sender.balance >= action.amount + action.fee){
let sender = await wo.Store.getBalance(action.actorAddress)
return action.actorAddress && action.toAddress && action.toAddress != action.actorAddress && action.amount && action.amount > 0 && sender >= action.amount + action.fee && action.fee >= wo.Config.MIN_FEE_ActTransfer
return action.actorAddress && action.toAddress && action.toAddress != action.actorAddress && action.amount && action.amount > 0 && sender >= action.amount + action.fee && action.fee >= wo.Config.MIN_FEE_ActionTransfer
}
DAD.execute = async function (action) {

View File

@ -1,6 +1,6 @@
const Action = require('./ling/Action.js')
const ActTransfer = require('./ling/ActTransfer.js')
const Action = require('./Action.js')
const ActionTransfer = require('./ActionTransfer.js')
module.exports = {
Action,
ActTransfer
ActionTransfer
}