fund hash改名txHash
This commit is contained in:
@@ -7,7 +7,7 @@ const DayLong = 24 * 60 * 60 * 1000;
|
|||||||
* 2 不可用,已耗尽
|
* 2 不可用,已耗尽
|
||||||
*/
|
*/
|
||||||
class Fund {
|
class Fund {
|
||||||
constructor (data) {
|
constructor (data = {}) {
|
||||||
const { amount, blockNumber, hash = '', blockHash = '', from = '', to = '', timeStamp, usdtValue = 0, type = 'deposit' } = data;
|
const { amount, blockNumber, hash = '', blockHash = '', from = '', to = '', timeStamp, usdtValue = 0, type = 'deposit' } = data;
|
||||||
this.status = 0;
|
this.status = 0;
|
||||||
this.type = type;
|
this.type = type;
|
||||||
@@ -18,7 +18,7 @@ class Fund {
|
|||||||
this.timeStamp = timeStamp;
|
this.timeStamp = timeStamp;
|
||||||
this.blockNumber = blockNumber;
|
this.blockNumber = blockNumber;
|
||||||
this.blockHash = blockHash;
|
this.blockHash = blockHash;
|
||||||
this.hash = hash;
|
this.txHash = hash;
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const exp = calExpirePeriod();
|
const exp = calExpirePeriod();
|
||||||
this.createdAt = now.toISOString();
|
this.createdAt = now.toISOString();
|
||||||
|
|||||||
@@ -108,7 +108,8 @@ FundModel.prototype.addFund = async function (txlist = [], option) {
|
|||||||
});
|
});
|
||||||
typeof action.save === 'function' && actionPromiseList.push(action.save());
|
typeof action.save === 'function' && actionPromiseList.push(action.save());
|
||||||
txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率 !!!!
|
txObj.amount = depositAmount; // 之后返回fundList里的数值需要把区块链的数值乘以比率 !!!!
|
||||||
return createNewFund(txObj);
|
mylog.info(txObj);
|
||||||
|
return createNewFund({...txObj});
|
||||||
});
|
});
|
||||||
// 1.注入资金
|
// 1.注入资金
|
||||||
const res = await FundModel.findByIdAndUpdate(this.id, {
|
const res = await FundModel.findByIdAndUpdate(this.id, {
|
||||||
|
|||||||
Reference in New Issue
Block a user