This commit is contained in:
Luk Lu
2022-07-03 16:02:58 +08:00
parent e3920911b0
commit f70b97cbb2
4 changed files with 143 additions and 70 deletions

View File

@@ -1,5 +1,5 @@
const Action = require('./Action.js')
const ticrypto = require('tic-crypto')
const ticc = require('tic-crypto')
const DAD = (module.exports = function ActionTransfer (prop) {
this._class = this.constructor.name
@@ -16,7 +16,7 @@ MOM.validateMe = function () {
return (
this.actorPubkey &&
this.toAddress &&
ticrypto.pubkey2address(this.actorPubkey) !== this.toAddress && // 不能转帐给自己。
ticc.pubkey_to_address({ pubkey: this.actorPubkey }) !== this.toAddress && // 不能转帐给自己。
this.amount &&
this.amount > 0 &&
this.fee >= 0