fund hash改名txHash

This commit is contained in:
chaosBreaking
2019-10-07 17:30:40 +08:00
parent 1dc5d4e284
commit 92fe47c441
2 changed files with 4 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ const DayLong = 24 * 60 * 60 * 1000;
* 2 不可用,已耗尽
*/
class Fund {
constructor (data) {
constructor (data = {}) {
const { amount, blockNumber, hash = '', blockHash = '', from = '', to = '', timeStamp, usdtValue = 0, type = 'deposit' } = data;
this.status = 0;
this.type = type;
@@ -18,7 +18,7 @@ class Fund {
this.timeStamp = timeStamp;
this.blockNumber = blockNumber;
this.blockHash = blockHash;
this.hash = hash;
this.txHash = hash;
const now = new Date();
const exp = calExpirePeriod();
this.createdAt = now.toISOString();

View File

@@ -108,7 +108,8 @@ FundModel.prototype.addFund = async function (txlist = [], option) {
});
typeof action.save === 'function' && actionPromiseList.push(action.save());
txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率
return createNewFund(txObj);
mylog.info(txObj);
return createNewFund({...txObj});
});
// 1.注入资金
const res = await FundModel.findByIdAndUpdate(this.id, {