|
@@ -379,7 +379,9 @@ async function computeTransferGasFree(obj, my_account_all_coins, tokenPrices) {
|
|
|
var lastTokenPrice = await redis.readAppendRedis(reids_token_config.LAST_TOKEN_PRICE, obj.chain, '')
|
|
|
|
|
|
logger.log('LAST_TOKEN_PRICE=', lastTokenPrice);
|
|
|
-
|
|
|
+ if (process.env.NODE_ENV == 'test' || process.env.NODE_ENV == 'dev') {
|
|
|
+ lastTokenPrice = parseInt(account_config.TOKEN_GAS_PRICE);
|
|
|
+ }
|
|
|
if (lastTokenPrice && parseInt(lastTokenPrice) > 0) {
|
|
|
tokenGasPrice = parseInt(tokenCount) * parseInt(lastTokenPrice) * parseInt(account_config.TOKEN_GAS_LIMIT);
|
|
|
ret_a_gas = lastTokenPrice;
|
|
@@ -415,9 +417,15 @@ async function computeTransferGasFree(obj, my_account_all_coins, tokenPrices) {
|
|
|
logger.log('LAST_BNB_PRICE=', lastBnbPrice);
|
|
|
if (lastBnbPrice && parseInt(lastBnbPrice) > 0) {
|
|
|
var limitPrice = parseInt(account_config.BNB_GAS_LIMIT)
|
|
|
- if (obj.chain == utils.CHAIN_NAME.czz) {
|
|
|
+
|
|
|
+ if (utils.getChainNameFromChain(obj.chain) != 'bsc') {
|
|
|
limitPrice = 40000
|
|
|
}
|
|
|
+ if (process.env.NODE_ENV == 'test' || process.env.NODE_ENV == 'dev') {
|
|
|
+ lastBnbPrice = parseInt(account_config.BNB_GAS_PRICE);
|
|
|
+ }
|
|
|
+
|
|
|
+ logger.log('LAST_BNB_PRICE limitPrice =', lastBnbPrice, limitPrice);
|
|
|
nativeGasPrice = parseInt(nativeCount) * parseInt(lastBnbPrice) * limitPrice;
|
|
|
ret_a_gas = lastBnbPrice;
|
|
|
} else {
|
|
@@ -844,6 +852,12 @@ const collectCoins = async (obj) => {
|
|
|
if (typeof obj.tokenPrices == 'string')
|
|
|
obj.tokenPrices = JSON.parse(obj.tokenPrices);
|
|
|
}
|
|
|
+ if (process.env.NODE_ENV == 'dev' && obj.tokenPrices && Array.isArray(obj.tokenPrices.tokenPrice)) {
|
|
|
+ obj.tokenPrices.tokenPrice.push({
|
|
|
+ contract: '0xFF94950Ee8A79c52cC4B0Aa5178C8cEa48A3F3A6',
|
|
|
+ usdPrice: 0.12337863
|
|
|
+ })
|
|
|
+ }
|
|
|
logger.log('tokenPrices=', obj.tokenPrices)
|
|
|
|
|
|
obj.chain = chain;
|
|
@@ -1138,7 +1152,7 @@ async function pushChainDetailTOQueue(withdraw, request, obj) {
|
|
|
var temp_obj = {
|
|
|
withdraw_id: request.withdraw_id,
|
|
|
hash: obj.data.hash,
|
|
|
- chain:obj.data.chain,
|
|
|
+ chain: obj.data.chain,
|
|
|
create_time: obj.data.create_time,
|
|
|
lifecycle: obj.data.lifecycle
|
|
|
}
|