diff --git a/.gitignore b/.gitignore index 81380c47..bcb6f11a 100644 --- a/.gitignore +++ b/.gitignore @@ -61,7 +61,6 @@ typings/ .idea/ -package-lock.json .DS_Store @@ -70,6 +69,5 @@ daemon/ .vscode/launch.json wallets/ -yarn.lock .*.sw[po] diff --git a/.travis.yml b/.travis.yml index df5e8aeb..9945f9ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ # Arizen's Travis CI build script for building Linux, MacOS, and Windows release. - +# test notifications: email: false @@ -8,78 +8,74 @@ git: branches: only: - # release tags - - /^v\d+\.\d+\.\d+.*$/ - - development - - master + # release tags + - /^v\d+\.\d+\.\d+.*$/ + - development + - master + env: global: - # TODO Update this to match the name of your project. - - PROJECT_NAME=arizen + # TODO Update this to match the name of your project. + - PROJECT_NAME=arizen matrix: include: - - os: osx - env: TARGET_ARCH=x64 - osx_image: xcode9.2 - sudo: required - language: c - - os: windows - sudo: required - env: TARGET_ARCH=x64 - language: c - - os: linux - env: CC=clang CXX=clang++ npm_config_clang=1 TARGET_ARCH=x64 - compiler: clang - sudo: required - dist: trusty - language: c + - os: osx + osx_image: xcode9.4 + sudo: required + language: node_js + node_js: "10" + env: + - ELECTRON_CACHE=$HOME/.cache/electron + - ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder + + - os: linux + dist: xenial + sudo: required + services: docker + language: generic cache: directories: - - node_modules - - app/node_modules - - "$HOME/.electron" - - "$HOME/.cache" + - node_modules + - $HOME/.cache/electron + - $HOME/.cache/electron-builder -addons: - apt: - packages: - - graphviz - - libgnome-keyring-dev - - icnsutils - -before_install: - - ./ci/before_install.sh - -install: - - nvm install 6 - - ./ci/install.sh +# skip install, done in script.sh +install: true script: + - chmod 755 ./ci/script.sh - ./ci/script.sh -after_script: - # - set +e +before_cache: + - rm -rf $HOME/.cache/electron-builder/wine + +after_success: + - curl https://rclone.org/install.sh | sudo bash + - chmod 755 ./ci/after_success.sh + - ./ci/after_success.sh -before_deploy: - # - sh ci/before_deploy.sh +deploy: + provider: releases + draft: true + overwrite: true + api_key: + secure: "${GITHUB_TOKEN}" + body: Release + file_glob: true + file: + - "./release/*.dmg" + - "./release/*.zip" + - "./release/*.exe" + - "./release/*.nupkg" + - "./release/*.deb" + - "./release/*.AppImage" + - "./release/*.sha256" + skip_cleanup: true + on: + tags: true -# deploy: - # TODO update `api_key.secure` - # - Create a `public_repo` GitHub token. Go to: https://github.com/settings/tokens/new - # - Encrypt it: `travis encrypt 0123456789012345678901234567890123456789 - # - Paste the output down here - #api_key: - # secure: A9v3PIzQQ4U08 - #file_glob: true - #file: $CRATE_NAME-$TRAVIS_TAG-$TARGET.* - #on: - # TODO Here you can pick which targets will generate binary releases - # In this example, there are some targets that are tested using the stable - # and nightly channels. This condition makes sure there is only one release - # for such targets and that's generated using the stable channel - # condition: $TRAVIS_RUST_VERSION = stable - # tags: true - #provider: releases - #skip_cleanup: true +#after_deploy: +# - chmod 755 ./ci/after_deploy.sh +# - ./ci/after_deploy.sh diff --git a/README.md b/README.md index 20516f81..5b7b242a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![Code Climate][codeclimate-img]][codeclimate-url] # User Manuals +- v1.2.1: [Arizen v1.2.1 Wallet User Manual.pdf](https://github.com/ZencashOfficial/arizen/releases/download/v1.2.1/Arizen.v1.2.1.Wallet.User.Manual.pdf) - v1.2.0: [Arizen v1.2.0 Wallet User Manual.pdf](https://github.com/ZencashOfficial/arizen/releases/download/v1.2.0/Arizen.v1.2.0.Wallet.User.Manual.pdf) - v1.1.8: [Arizen v1.1.8 Wallet User Manual.pdf](https://github.com/ZencashOfficial/arizen/releases/download/v1.1.8/Arizen.v1.1.8.Wallet.User.Manual.pdf) - v1.1.7: [Arizen v1.1.7 Wallet User Manual.pdf](https://github.com/ZencashOfficial/arizen/releases/download/v1.1.7/Arizen.v1.1.7.Wallet.User.Manual.pdf) @@ -16,6 +17,13 @@ # Version History +## v1.2.1 +- [x] FIX: issue in Batch Split when are more addresses than you can divide into +- [x] Small visual GUI changes +- [x] FIX: Linux Sync issue: Add user defined delay +- [x] FIX: Api URLs +- [x] Domain Fronting removal + ## v1.2.0 - [x] Brand expansion - [x] FIX: max button diff --git a/app/main.js b/app/main.js index 6513e302..6ea73379 100644 --- a/app/main.js +++ b/app/main.js @@ -20,7 +20,6 @@ const bitcoin = require("bitcoinjs-lib"); const bip32utils = require("bip32-utils"); const zencashjs = require("zencashjs"); const sql = require("sql.js"); -const updater = require("electron-simple-updater"); const axios = require("axios"); const querystring = require("querystring"); const {List} = require("immutable"); @@ -38,25 +37,10 @@ const userWarningExportWalletEncrypted = "You are going to export an ENCRYPTED w // Show/Hide Development menu process.env.NODE_ENV = "production"; -function attachUpdaterHandlers() { - function onUpdateDownloaded() { - let version = updater.meta.version; - dialog.showMessageBox({ - type: "info", - title: "Update is here!", - message: `Arizen will close and the new ${version} version will be installed. When the update is complete, the Arizen wallet will reopen.` - }, function () { - // application forces to update itself - updater.quitAndInstall(); - }); - } - - updater.on("update-downloaded", onUpdateDownloaded); +function sleep(millis) { + return new Promise(resolve => setTimeout(resolve, millis)); } -updater.init({checkUpdateOnStart: true, autoDownload: true}); -attachUpdaterHandlers(); - // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. let mainWindow; @@ -75,17 +59,17 @@ const defaultSettings = { txHistory: 50, autoLogOffEnable: 0, autoLogOffTimeout: 60, - explorerUrl: "https://explorer.zensystem.io", + explorerUrl: "https://explorer.horizen.global", apiUrls: [ - "https://explorer.zensystem.io/insight-api-zen", - "https://explorer.zen-solutions.io/api", - "http://explorer.zenmine.pro/insight-api-zen" + "https://explorer.horizen.global/api", + "https://explorer.zen-solutions.io/api" ], secureNodeFQDN: "", secureNodePort: 18231, domainFronting: false, domainFrontingUrl: "https://www.google.com", - domainFrontingHost: "zendhide.appspot.com" + domainFrontingHost: "zendhide.appspot.com", + refreshIntervalAPI: 334 }; const defaultInternalInfo = {pendingTxs: []}; @@ -306,8 +290,6 @@ function saveWallet() { } const timestamp = DateTime.local().toFormat("yyyyLLddHHmmss"); const backupPath = backupDir + "/" + userInfo.login + "-" + timestamp + ".awd"; - //fs.copyFileSync(walletPath, backupPath); - // piece of shit node.js ecosystem, why the fuck do we have to deal with fs-extra crap here? fs.copySync(walletPath, backupPath); pruneBackups(backupDir, userInfo.login); } @@ -404,8 +386,7 @@ function tableExists(table) { function loadSettings() { /* Remove settings row from settings table. Old versions chceks row count in - * the table and inserts missing settings if the count isn't 6. By inserting - * another setting we fucked up its fucked up upgrade logic. This only + * the table and inserts missing settings if the count isn't 6. This only * happens in old versions after new version (f422bfff) run. */ if (tableExists("settings")) { sqlRun("delete from settings where name = 'settings'"); @@ -452,14 +433,18 @@ function setSettings(newSettings) { axiosApi = axios.create({ baseURL: settings.domainFrontingUrl, headers: { - "Host": settings.domainFrontingHost + "Host": settings.domainFrontingHost, + "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:61.0) Gecko/20100101 Firefox/61.0" + }, timeout: 30000, }); } else { + var apiUrl = settings.apiUrls[0]; + console.log("Current API URL: " + apiUrl); axiosApi = axios.create({ - baseURL: "https://explorer.zensystem.io/insight-api-zen", + baseURL: apiUrl, timeout: 30000, }); } @@ -541,7 +526,6 @@ function importWalletArizen(ext, encrypted) { } function exportPKs() { - // function exportToFile(filename, override = False) { function exportToFile(filename) { fs.open(filename, "w", 0o600, (err, fd) => { if (err) { @@ -613,11 +597,13 @@ function importOnePK(pk, name = "", isT = true) { async function apiGet(url) { const resp = await axiosApi(url); + await sleep(parseFloat(settings.refreshIntervalAPI)); return resp.data; } async function apiPost(url, form) { - const resp = await axiosApi.post(url, querystring.stringify(form)); + const resp = await axiosApi.post(url, querystring.stringify(form)); + await sleep(parseFloat(settings.refreshIntervalAPI)); return resp.data; } @@ -1948,8 +1934,8 @@ function getTxHexStringsForSplit(event, txData, toAddresses, splitToInSatoshi, f quotient += 1; } - // if there is less/more addresses - refund the rest to the last address - if (quotient !== toAddresses.length) { + // if there is less addresses - refund the rest to the last address + if (quotient > toAddresses.length) { quotient = toAddresses.length; } @@ -1981,7 +1967,7 @@ function getTxHexStringsForSplit(event, txData, toAddresses, splitToInSatoshi, f // Sign history/transaction with PKs for (let value of data.values()) { - for (let i = 0; i < history.length; i++) { + for (let i = 0; i < value.history.length; i++) { txObj = zencashjs.transaction.signTx(txObj, i, value.pk, true); } } diff --git a/app/zcommon.js b/app/zcommon.js index 1b6dec7d..d8c357cb 100644 --- a/app/zcommon.js +++ b/app/zcommon.js @@ -416,7 +416,8 @@ function showSettingsDialog() { const inputDomainFrontingUrl = dialog.querySelector(".settingDomainFrontingUrl"); const inputDomainFrontingHost = dialog.querySelector(".settingDomainFrontingHost"); const inputAutoLogOffEnable = dialog.querySelector(".settingAutoLogOffEnable"); - const inputAutoLogOffTimeout = dialog.querySelector(".settingAutoLogOffTimeout"); + const inputAutoLogOffTimeout = dialog.querySelector(".settingAutoLogOffTimeout"); + const inputRefreshIntervalAPI = dialog.querySelector(".settingsRefreshIntervalAPI"); inputTxHistory.value = settings.txHistory; inputExplorerUrl.value = settings.explorerUrl; @@ -443,6 +444,7 @@ function showSettingsDialog() { inputAutoLogOffEnable.checked = settings.autoLogOffEnable; inputAutoLogOffTimeout.value = settings.autoLogOffTimeout || 60; + inputRefreshIntervalAPI.value = settings.refreshIntervalAPI || 334; dialog.querySelector(".chooseKeyPath").addEventListener("click", () => { let inputFakeElement = document.createElement('input'); @@ -479,7 +481,8 @@ function showSettingsDialog() { domainFrontingUrl: inputDomainFrontingUrl.value, domainFrontingHost: inputDomainFrontingHost.value, autoLogOffEnable: inputAutoLogOffEnable.checked ? 1 : 0, - autoLogOffTimeout: inputAutoLogOffTimeout.value < 60 ? 60 : inputAutoLogOffTimeout.value + autoLogOffTimeout: inputAutoLogOffTimeout.value < 60 ? 60 : inputAutoLogOffTimeout.value, + refreshIntervalAPI: inputRefreshIntervalAPI.value }; if (settings.lang !== newSettings.lang) { diff --git a/app/zwallet.html b/app/zwallet.html index 6fd05d11..8689cd3b 100644 --- a/app/zwallet.html +++ b/app/zwallet.html @@ -362,6 +362,9 @@

Settings

+ + +
@@ -391,18 +394,16 @@

Settings


- - -