Skip to content

Commit

Permalink
Merge pull request #22 from VerusCoin/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Asherda authored Feb 9, 2020
2 parents 410b3e8 + f92993d commit b7a4aeb
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 45 deletions.
24 changes: 8 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ stages:
########################################################################################################################
variables:
DOCKER_DRIVER: overlay2
DEFAULT_VERUSCOIN_BRANCH: master
VERUS_VERSION: 0.6.4-beta
VERUSCOIN_VERSION: 0.6.4
DEFAULT_VERUSCOIN_BRANCH: release
VERUS_VERSION: 0.6.4-beta-1
VERUSCOIN_VERSION: 0.6.4-1
KOMODO_VERSION: 0.5.2
BINARY_SOURCE: VerusCoin
VERUS_APPIMAGE_X64: Verus-Desktop-Linux-v${VERUS_VERSION}-x86_64.AppImage
VERUS_APPIMAGE_ARM64: Verus-Desktop-Linux-v${VERUS_VERSION}-arm64.AppImage
VERUS_LINUX_TAR: Verus-Desktop-Linux-v${VERUS_VERSION}-amd64.tar.gz
VERUS_LINUX_TAR: Verus-Desktop-Linux-v${VERUS_VERSION}-x86_64.tar.gz
VERUS_LINUX_ARM64_TAR: Verus-Desktop-Linux-v${VERUS_VERSION}-arm64.tar.gz
VERUS_WINDOWS_ZIP: Verus-Desktop-Windows-v${VERUS_VERSION}.zip
VERUS_WINDOWS_NSIS: Verus-Desktop-Windows-v${VERUS_VERSION}.exe
Expand Down Expand Up @@ -80,7 +80,6 @@ build:linux:
artifacts:
paths:
- ${VERUS_LINUX_TAR}
- ${VERUS_LINUX_TAR}.sha256
expire_in: 1 week

build:linux:arm64:
Expand Down Expand Up @@ -124,7 +123,6 @@ build:linux:arm64:
artifacts:
paths:
- ${VERUS_LINUX_ARM64_TAR}
- ${VERUS_LINUX_ARM64_TAR}.sha256
- dist
expire_in: 1 week
########################################################################################################################
Expand All @@ -151,12 +149,14 @@ build:windows:
- cd ../../..
- mkdir -p assets/bin/win64/komodod
- wget https://github.com/KomodoPlatform/komodo/releases/download/${KOMODO_VERSION}/win64_${KOMODO_VERSION}.zip
- unzip win64_${KOMODO_VERSION}.zip -d assets/bin/komodod
- unzip win64_${KOMODO_VERSION}.zip
- mv win64/komodod.exe win64/komodo-cli.exe assets/bin/win64/komodod
- rm -rf win64
- rm win64_${KOMODO_VERSION}.zip
- gsutil cp $STAGING/$VERUS_CLI_WINDOWS .
- unzip -qq Verus-CLI-Windows-v${VERUSCOIN_VERSION}.zip -d assets/bin/win64
- mv assets/bin/win64/verus-cli assets/bin/win64/verusd
- strip --strip-unneeded assets/bin/win64/komodod/komodod.exe && strip --strip-unneeded assets/bin/win64/komodod/komodo-cli.exe && strip --strip-unneeded assets/bin/win64/komodod/komodo-tx.exe
- strip --strip-unneeded assets/bin/win64/komodod/komodod.exe && strip --strip-unneeded assets/bin/win64/komodod/komodo-cli.exe
- rm Verus-CLI-Windows-v${VERUSCOIN_VERSION}.zip
- gsutil cp $STAGING/VerusCoin/Zcash/zcashd-win.tar.gz .
- tar -xzvf zcashd-win.tar.gz --directory assets/bin/win64/
Expand Down Expand Up @@ -186,9 +186,7 @@ build:windows:
artifacts:
paths:
- ${VERUS_WINDOWS_ZIP}
- ${VERUS_WINDOWS_ZIP}.sha256
- ${VERUS_WINDOWS_NSIS}
- ${VERUS_WINDOWS_NSIS}.sha256
expire_in: 1 week
########################################################################################################################
####END#### WINDOWS ####END####
Expand Down Expand Up @@ -235,7 +233,6 @@ build:mac:
artifacts:
paths:
- ${VERUS_MACOS}
- ${VERUS_MACOS}.sha256
expire_in: 1 week


Expand All @@ -261,13 +258,8 @@ deploy:
artifacts:
paths:
- ${VERUS_LINUX_TAR}
- ${VERUS_LINUX_TAR}.sha256
- ${VERUS_LINUX_ARM64_TAR}
- ${VERUS_LINUX_ARM64_TAR}.sha256
- ${VERUS_WINDOWS_ZIP}
- ${VERUS_WINDOWS_ZIP}.sha256
- ${VERUS_WINDOWS_NSIS}
- ${VERUS_WINDOWS_NSIS}.sha256
- ${VERUS_MACOS}
- ${VERUS_MACOS}.sha256
expire_in: 1 week
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "verus-desktop",
"productName": "Verus-Desktop",
"version": "0.6.4-beta",
"version": "0.6.4-beta-1",
"description": "Verus Desktop Wallet App",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion routes/api/electrum/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = (api) => {
protocol: "Electrum",
name,
txfee,
server: `${server.ip}:${server.port}:${server.port}`,
server: `${server.ip}:${server.port}:${server.proto}`,
serverList: serverList.toString()
}}));

Expand Down
22 changes: 16 additions & 6 deletions routes/api/native/addrBalance.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ const { fromSats } = require("agama-wallet-lib/src/utils");
const BYTES_PER_MB = 1000000

module.exports = (api) => {
// Gets an address balance (z_getbalance)
api.native.get_addr_balance = async (coin, token, address, useCache, txCount) => {
// Gets an address balance (z_getbalance), txCount and zTotalBalance are used
// to check if the cache needs to be cleared and re-built
api.native.get_addr_balance = async (coin, token, address, useCache, txCount = -1, zTotalBalance = -1) => {
const cacheAddrBalanceResult = (result) => {
const cacheSize = getObjBytes(api.native.cache);

Expand All @@ -25,16 +26,25 @@ module.exports = (api) => {

if (useCache) {
if (
api.native.cache.addr_balance_cache[coin] != null &&
txCount !== api.native.cache.addr_balance_cache[coin].tx_count
api.native.cache.addr_balance_cache[coin] != null
) {
api.native.cache.addr_balance_cache[coin].tx_count = txCount;
delete api.native.cache.addr_balance_cache[coin].data;
if (txCount !== api.native.cache.addr_balance_cache[coin].tx_count) {
api.native.cache.addr_balance_cache[coin].tx_count = txCount;
delete api.native.cache.addr_balance_cache[coin].data;
}

if (zTotalBalance !== api.native.cache.addr_balance_cache[coin].total_balance) {
api.native.cache.addr_balance_cache[coin].total_balance = zTotalBalance;
if (api.native.cache.addr_balance_cache[coin].data != null) {
delete api.native.cache.addr_balance_cache[coin].data;
}
}
}

if (api.native.cache.addr_balance_cache[coin] == null) {
api.native.cache.addr_balance_cache[coin] = {
tx_count: -1,
total_balance: -1,
data: {}
};
} else if (api.native.cache.addr_balance_cache[coin].data == null) {
Expand Down
2 changes: 1 addition & 1 deletion routes/api/native/addresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ module.exports = (api) => {
(!isZ && tBalanceSeen < totalTBalance)
) {
balanceObj.native = Number(
await api.native.get_addr_balance(coin, token, address, true, txcount)
await api.native.get_addr_balance(coin, token, address, true, txcount, Number(totalBalance.total))
);

isZ
Expand Down
17 changes: 13 additions & 4 deletions routes/api/native/idInformation.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,18 @@ const Promise = require('bluebird');

module.exports = (api) => {
api.native.get_identities = (coin, token, includeCanSpend = true, includeCanSign = false, includeWatchOnly = false) => {
const promiseArr = [
api.native.callDaemon(coin, 'listidentities', [includeCanSpend, includeCanSign, includeWatchOnly], token),
api.native.callDaemon(coin, "z_gettotalbalance", [], token)
]

return new Promise((resolve, reject) => {
api.native.callDaemon(coin, 'listidentities', [includeCanSpend, includeCanSign, includeWatchOnly], token)
.then(async (identities) => {
Promise.all(promiseArr)
.then(async (resultArr) => {
const identities = resultArr[0]
const balances = resultArr[1]
const totalBalance = Number(balances.total)

if (!identities) {
resolve([])
} else {
Expand All @@ -28,13 +37,13 @@ module.exports = (api) => {
let zBalance = null

const iBalance = Number(
await api.native.get_addr_balance(coin, token, iAddr, useCache, txcount)
await api.native.get_addr_balance(coin, token, iAddr, useCache, txcount, totalBalance)
)

if (zAddr != null) {
try {
zBalance = Number(
await api.native.get_addr_balance(coin, token, zAddr, useCache, txcount)
await api.native.get_addr_balance(coin, token, zAddr, useCache, txcount, totalBalance)
);
} catch (e) {
api.log(e, "get_identities");
Expand Down
12 changes: 1 addition & 11 deletions routes/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const zcashParamsSources = require('./zcashParamsSources')

let zCoins = {}
let nativeCoinStrings = {}
let rpcCooldownTimes = {}

const coinObjArray = coinDataTranslated.getSimpleCoinArray().map(simpleCoinObj => {
const coinObj = coinDataTranslated.getCoinObj(simpleCoinObj.id, false)
Expand All @@ -14,7 +13,6 @@ const coinObjArray = coinDataTranslated.getSimpleCoinArray().map(simpleCoinObj =

if (coinObj.available_modes.native === true) {
nativeCoinStrings[coinObj.id] = ''
rpcCooldownTimes[coinObj.id] = 2000
}

return coinObj
Expand Down Expand Up @@ -81,8 +79,7 @@ const appConfig = {
includePrivateBalances: zCoins,
includePrivateTransactions: zCoins,
stakeGuard: nativeCoinStrings,
dataDir: nativeCoinStrings,
rpcCooldownTimeout: rpcCooldownTimes
dataDir: nativeCoinStrings
}
},
pubkey: "",
Expand Down Expand Up @@ -203,13 +200,6 @@ const appConfig = {
type: "text_input",
displayName: "Custom data directory",
info: "A custom directory for coin data."
},
rpcCooldownTimeout: {
type: "number_input",
displayName: "Wallet Call Cooldown Timeout (MS)",
info:
"The maximum number of milliseconds in cooldown time that the wallet " +
"will take in between each call to the blockchain native wallet."
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion routes/shepherd/electrum/parseTxAddresses.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module.exports = (shepherd) => {
const amount = _sum.inputs - _sum.outputs

result = {
type: amount < 0 ? 'interest' : 'self',
type: 'self',
amount: Number(amount).toFixed(8),
address: targetAddress,
timestamp: tx.timestamp,
Expand Down
4 changes: 2 additions & 2 deletions version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=0.6.4-beta
version=0.6.4-beta-1
type=beta
minversion=0.6.4-beta
minversion=0.6.4-beta-1
2 changes: 1 addition & 1 deletion version_build
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.4-beta
0.6.4-beta-1

0 comments on commit b7a4aeb

Please sign in to comment.