Skip to content

Commit

Permalink
Merge pull request #394 from ZencashOfficial/development
Browse files Browse the repository at this point in the history
v1.2.1
  • Loading branch information
zennermac authored Feb 27, 2019
2 parents 135bf7a + 409ddb8 commit 803a0ee
Show file tree
Hide file tree
Showing 15 changed files with 8,075 additions and 282 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ typings/


.idea/
package-lock.json
.DS_Store


Expand All @@ -70,6 +69,5 @@ daemon/
.vscode/launch.json
wallets/

yarn.lock

.*.sw[po]
118 changes: 57 additions & 61 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Arizen's Travis CI build script for building Linux, MacOS, and Windows release.

# test
notifications:
email: false

Expand All @@ -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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
54 changes: 20 additions & 34 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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;
Expand All @@ -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: []};
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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'");
Expand Down Expand Up @@ -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,
});
}
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
}
}
Expand Down
7 changes: 5 additions & 2 deletions app/zcommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down
21 changes: 11 additions & 10 deletions app/zwallet.html
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,9 @@ <h2 slot=headerText data-tr=wallet.settings.label>Settings</h2>
<label for=settingsApiUrls title="Place one URL per line" data-tr=wallet.settings.apiUrl>API URLs</label>
<textarea type=text name=settingsApiUrls class=settingsApiUrls rows=5></textarea>

<label for=refreshIntervalAPI data-tr=wallet.settings.refreshIntervalAPI>API Refresh Interval (ms)</label>
<input type=text name=settingsRefreshIntervalAPI class=settingsRefreshIntervalAPI />

<hr class=formDivider />

<label for=secureNodeFQDN data-tr=wallet.settings.secureNodeFQDN>Secure Node FQDN</label>
Expand Down Expand Up @@ -391,18 +394,16 @@ <h2 slot=headerText data-tr=wallet.settings.label>Settings</h2>
<input type=text name=settingsForwardTimeout class=settingsForwardTimeout />

<hr class=formDivider />

<label for=enableDomainFronting data-tr=wallet.settings.enableDomainFronting>Enable domain fronting</label>
<label class=container>
<label for=enableDomainFronting data-tr=wallet.settings.enableDomainFronting style="visibility:hidden;display: none">Enable domain fronting</label>
<label class=container style="visibility:hidden;display: none">
<input type=checkbox class=enableDomainFronting name=enableDomainFronting />
<span class=checkmark></span>
</label>
<label for=settingDomainFrontingUrl data-tr=wallet.settings.domainFrontingUrl>Domain fronting public base URL</label>
<input type=text name=settingDomainFrontingUrl class=settingDomainFrontingUrl />
<label for=settingDomainFrontingHost data-tr=wallet.settings.domainFrontingHost>Domain fronting private host</label>
<input type=text name=settingDomainFrontingHost class=settingDomainFrontingHost />

<hr class=formDivider />
<label for=settingDomainFrontingUrl data-tr=wallet.settings.domainFrontingUrl style="visibility:hidden;display: none">Domain fronting public base URL</label>
<input type=text name=settingDomainFrontingUrl class=settingDomainFrontingUrl style="visibility:hidden;display: none" />
<label for=settingDomainFrontingHost data-tr=wallet.settings.domainFrontingHost style="visibility:hidden;display: none">Domain fronting private host</label>
<input type=text name=settingDomainFrontingHost class=settingDomainFrontingHost style="visibility:hidden;display: none" />
<hr class=formDivider style="visibility:hidden;display: none"/>
</div>
<div class=formButtons>
<button class=settingsSave data-tr=wallet.settings.save>Save</button>
Expand Down Expand Up @@ -453,9 +454,9 @@ <h2 slot=headerText data-tr=wallet.changePassword.title>Change Wallet Password</
</div>
<div class=headerRight>
<span><button onclick="showSettingsDialog()" data-tr=wallet.showSettingsDialogButton>Settings</button></span>
<span><button onclick="showAboutDialog()" data-tr=wallet.showAboutDialogButton>About</button></span>
<span><button id=refreshButton data-tr=wallet.refreshWallet>Refresh</button></span>
<span><button onclick='logout()' data-tr=wallet.logout>Logout</button></span>
<span><button onclick="showAboutDialog()" data-tr=wallet.showAboutDialogButton>About</button></span>
<span><button onclick='exitApp()' data-tr=wallet.exit>Exit</button></span>
</div>
</header>
Expand Down
Loading

0 comments on commit 803a0ee

Please sign in to comment.