Merge pull request #1547 from Luis-Fernando-Molina/develop

Contribution: Bug Fixed with Trading Engine Values not at angle
This commit is contained in:
Luis Fernando Molina authored and GitHub committed 2021-08-25 07:55:50 -04:00
commit 13dc420032
3 files changed
+13 -9

No files matched your search

+1
View File
@@ -744,6 +744,7 @@ exports.newHttpInterface = function newHttpInterface() {
console.log('1. Make sure that you have set up your Github Username and Token at the APIs -> Github API node at the workspace.')
console.log('2. Make sure you are running the latest version of Git available for your OS.')
console.log('3. Make sure that you have cloned your Superalgos repository fork, and not the main Superalgos repository.')
console.log('4. If your fork is old, you might need to do an app.update and also a node setup at every branch. If you just reforked all is good.')
error = err
}
}
@@ -133,6 +133,7 @@ function newRecordValues() {
if (node.payload.uiObject === undefined) { return }
if (value === true) { value = 'true' }
if (value === false) { value = 'false' }
node.payload.uiObject.valueAtAngle = true
node.payload.uiObject.setValue(value, 1, minDecimals)
}
}
@@ -15,8 +15,7 @@ function newGovernanceUserProfileSpace() {
}
let waitingForResponses = 0
let timer = 0
const BSC_SCAN_RATE_LIMIT_DELAY = 7000
const BSC_SCAN_RATE_LIMIT_DELAY = 6000
let reputationByAddress = new Map()
return thisObject
@@ -51,7 +50,7 @@ function newGovernanceUserProfileSpace() {
/*
Here we will setup the Reputation for each profile.
*/
timer = timer + BSC_SCAN_RATE_LIMIT_DELAY
waitingForResponses++
getTreasuryAccountTransactions()
@@ -294,10 +293,10 @@ function newGovernanceUserProfileSpace() {
if (userProfile.payload.blockchainTokens === undefined) {
getBlockchainAccount(userProfile)
return
}
}
function getBlockchainAccount(userProfile) {
let signature = UI.projects.foundations.utilities.nodeConfig.loadConfigProperty(userProfile.payload, 'signature')
if (signature === undefined || signature === "") { return }
@@ -337,8 +336,7 @@ function newGovernanceUserProfileSpace() {
) {
waitingForResponses++
userProfile.payload.blockchainTokens = 0 // We need to set this value here so that the next call to BSCSCAN is not done more than once.
setTimeout(getBlockchainTokens, timer, userProfile, blockchainAccount)
timer = timer + BSC_SCAN_RATE_LIMIT_DELAY
setTimeout(getBlockchainTokens, BSC_SCAN_RATE_LIMIT_DELAY, userProfile, blockchainAccount)
}
}
}
@@ -351,9 +349,13 @@ function newGovernanceUserProfileSpace() {
return response.json();
}).then(function (data) {
console.log(data)
userProfile.payload.uiObject.setInfoMessage(data)
userProfile.payload.blockchainTokens = Number(data.result) / 1000000000000000000
userProfile.payload.reputation = Math.min(reputationByAddress.get(blockchainAccount.toLowerCase()) | 0, userProfile.payload.blockchainTokens)
if (data.result === "Max rate limit reached, please use API Key for higher rate limit") {
userProfile.payload.blockchainTokens = undefined // This enables this profile to query the blockchain again.
} else {
userProfile.payload.uiObject.setInfoMessage(data)
userProfile.payload.blockchainTokens = Number(data.result) / 1000000000000000000
userProfile.payload.reputation = Math.min(reputationByAddress.get(blockchainAccount.toLowerCase()) | 0, userProfile.payload.blockchainTokens)
}
waitingForResponses--
}).catch(function (err) {
const message = err.message + ' - ' + 'Can not access BSC SCAN servers.'