Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #37
Browse files Browse the repository at this point in the history
Release v0.3.1
  • Loading branch information
bsrinivas8687 authored Apr 29, 2021
2 parents 5701d46 + 42df366 commit df6c8fc
Show file tree
Hide file tree
Showing 31 changed files with 697 additions and 482 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/build
/cli
/dist
/build.js
20 changes: 19 additions & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,41 @@ builder.build({
productName: 'Sentinel',
compression: compression,
linux: {
artifactName: 'sentinel-linux-${version}.${ext}',
category: 'Utility',
executableName: 'sentinel',
icon: './electron/',
target: [
'AppImage',
'deb',
'dir',
'tar.gz',
'zip',
],
},
mac: {
artifactName: 'sentinel-darwin-${version}.${ext}',
category: 'public.app-category.utilities',
icon: './electron/icon.icns',
hardenedRuntime: true,
gatekeeperAssess: false,
minimumSystemVersion: '10.12.0',
forceCodeSigning: true,
entitlements: './electron/entitlements.mac.plist',
entitlementsInherit: './electron/entitlements.mac.plist',
},
win: {
artifactName: 'sentinel-windows-${version}.${ext}',
icon: './electron/icon.ico',
target: [
'nsis',
'zip',
],
},
publish: {
provider: 'github',
owner: 'sentinel-official',
repo: 'desktop-client',
releaseType: 'release',
},
},
}).then(() => {
Expand Down
3 changes: 3 additions & 0 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ all: mod_verify test benchmark install
install: mod_verify
go build -mod=readonly ${BUILD_FLAGS} -o ${GOPATH}/bin/sdccli main.go

build: mod_verify
go build -mod=readonly ${BUILD_FLAGS} -o ../bin/manager main.go

test:
@go test -mod=readonly -cover ${PACKAGES}

Expand Down
8 changes: 8 additions & 0 deletions electron/entitlements.mac.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
</dict>
</plist>
2 changes: 2 additions & 0 deletions electron/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
const path = require('path');
const menu = require('./menu');
const globals = require('./globals');
const { autoUpdater } = require('electron-updater');

Menu.setApplicationMenu(menu);
app.commandLine.appendSwitch('ignore-certificate-errors', 'true');
Expand Down Expand Up @@ -34,6 +35,7 @@ const createMainWindow = () => {
};

app.on('ready', () => {
autoUpdater.checkForUpdates().catch(console.error);
createMainWindow();
});

Expand Down
4 changes: 2 additions & 2 deletions electron/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ const {
const globals = require('./globals');

ipcMain.on(MANAGER_LISTEN_URL_GET_REQUEST, (event, args) => {
console.log('EVENT:', event, 'ARGS:', args);
console.log('EVENT: MANAGER_LISTEN_URL_GET_REQUEST', 'ARGS:', args);

event.returnValue = globals.listenURL;
});

ipcMain.on(MANAGER_START_REQUEST, (event, args) => {
console.log('EVENT:', event, 'ARGS:', args);
console.log('EVENT: MANAGER_START_REQUEST', 'ARGS:', args);

const manager = spawn(
path.join(__dirname, '../bin/manager'),
Expand Down
16 changes: 15 additions & 1 deletion electron/menu.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
const { Menu } = require('electron');
const {
app,
Menu,
} = require('electron');
const { autoUpdater } = require('electron-updater');
const logger = require('electron-log');

const template = [
{
Expand All @@ -7,10 +12,19 @@ const template = [
{
label: 'About',
},
{
label: 'Check for Updates...',
click: async () => {
logger.transports.file.level = 'debug';
autoUpdater.logger = logger;
await autoUpdater.checkForUpdates();
},
},
{
type: 'separator',
},
{
label: `Quit Sentinel v${app.getVersion()}`,
role: 'quit',
},
],
Expand Down
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sentinel",
"version": "0.3.0",
"version": "0.3.1",
"main": "./electron/index.js",
"homepage": "./",
"description": "Sentinel desktop and web client.",
Expand All @@ -9,26 +9,30 @@
"email": "[email protected]",
"url": "https://sentinel.co"
},
"private": true,
"private": false,
"dependencies": {
"electron-log": "^4.3.4",
"electron-updater": "^4.3.8"
},
"devDependencies": {
"@material-ui/core": "^4.11.3",
"@material-ui/core": "^4.11.4",
"@material-ui/icons": "^4.11.2",
"@ramonak/react-progress-bar": "^2.1.3",
"@ramonak/react-progress-bar": "^3.1.0",
"async": "^3.2.0",
"axios": "^0.21.1",
"bech32": "^2.0.0",
"bignumber.js": "^9.0.1",
"bootstrap": "^4.6.0",
"electron": "^12.0.2",
"electron": "^12.0.5",
"electron-builder": "^22.10.5",
"env-cmd": "^10.1.0",
"eslint": "^7.23.0",
"eslint": "^7.25.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-react": "^7.23.1",
"eslint-plugin-sort-exports": "^0.3.2",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-sort-exports": "^0.4.0",
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
"lodash": "^4.17.21",
"prop-types": "^15.7.2",
Expand All @@ -38,11 +42,11 @@
"react-copy-to-clipboard": "^5.0.3",
"react-dom": "^17.0.2",
"react-download-link": "^2.3.0",
"react-redux": "^7.2.3",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-simple-maps": "^2.3.0",
"redux": "^4.0.5",
"redux": "^4.1.0",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.3.0"
},
Expand Down
8 changes: 8 additions & 0 deletions src/actions/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
KEYS_POST_ERROR,
KEYS_POST_IN_PROGRESS,
KEYS_POST_SUCCESS,
KEY_MNEMONIC_SAVED_SET,
KEY_MNEMONIC_SET,
KEY_NAME_SET,
KEY_PASSWORD_SET,
Expand Down Expand Up @@ -116,6 +117,13 @@ export const setKeyMnemonic = (data) => {
};
};

export const setKeyMnemonicSaved = (data) => {
return {
type: KEY_MNEMONIC_SAVED_SET,
data,
};
};

export const postKeysInProgress = (data) => {
return {
type: KEYS_POST_IN_PROGRESS,
Expand Down
4 changes: 3 additions & 1 deletion src/actions/transactions/withdraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ export const txWithdraw = (cb = emptyFunc) => (dispatch, getState) => {
memo,
},
},
delegations: { items: delegations },
} = getState();

const validators = from.value === 'All' ? delegations.map((item) => item['validator_address']) : [from.value.trim()];
const item = Lodash.find(items, ['name', name]);
const url = txWithdrawURL(item.address);
Axios.post(url, {
validators: [from.value.trim()],
validators,
memo: memo.value.trim(),
password: password.value.trim(),
})
Expand Down
1 change: 1 addition & 0 deletions src/actions/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const getValidators = (cb = emptyFunc) => (dispatch, getState) => {
}
});

result = Lodash.shuffle(result);
dispatch(getValidatorsSuccess(result));
next(null);
},
Expand Down
10 changes: 9 additions & 1 deletion src/components/Checkbox/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@ import * as PropTypes from 'prop-types';
import React from 'react';

const Checkbox = ({
checked,
className,
id,
onChange,
}) => {
return (
<input
checked={checked}
className={className}
id="check"
id={id}
type="checkbox"
onChange={onChange}
/>
);
};

Checkbox.propTypes = {
checked: PropTypes.bool.isRequired,
className: PropTypes.string.isRequired,
id: PropTypes.string.isRequired,
onChange: PropTypes.func.isRequired,
};

export default Checkbox;
2 changes: 1 addition & 1 deletion src/components/ProgressBar/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}

.bar-container > div > div > div {
background: #129EED;
background-color: #129EED !important;
border: 3px solid #153F6A;
box-sizing: border-box;
box-shadow: 0 -2px 14px rgba(18, 158, 237, 0.3);
Expand Down
10 changes: 10 additions & 0 deletions src/components/SelectField/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ const SelectField = ({
</MenuItem>
))
}
{
items.length > 1 && (
<MenuItem
key={-1}
className={menuItemClassName}
value="All">
All
</MenuItem>
)
}
</Select>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/constants/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ export const COIN_DECIMALS = 6;

export const numberInputInvalidKeys = ['-', '+', 'e'];
export const numberInputInvalidKeyCodes = [69, 187, 189];

export const HTTPSURLRegex = /https?/;
1 change: 1 addition & 0 deletions src/constants/keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const KEY_NAME_SET = 'KEY_NAME_SET';
export const KEY_PASSWORD_SET = 'KEY_PASSWORD_SET';
export const KEYS_PASSWORD_VISIBLE_SET = 'KEYS_PASSWORD_VISIBLE_SET';
export const KEY_MNEMONIC_SET = 'KEY_MNEMONIC_SET';
export const KEY_MNEMONIC_SAVED_SET = 'KEY_MNEMONIC_SAVED_SET';

export const KEYS_POST_IN_PROGRESS = 'KEYS_POST_IN_PROGRESS';
export const KEYS_POST_SUCCESS = 'KEYS_POST_SUCCESS';
Expand Down
6 changes: 3 additions & 3 deletions src/containers/CreateKey/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const CreateKey = ({ history }) => {
<div className="form-group">
<Label
className="label"
label="Name"
label="Name *"
/>
<Name/>
</div>
<div className="password-box create-key-password">
<div className="form-group">
<Label
className="label"
label="PASSWORD"
label="Password *"
/>
<Password/>
</div>
Expand All @@ -44,7 +44,7 @@ const CreateKey = ({ history }) => {
<div className="form-group">
<Label
className="label"
label="Mnemonic"
label="Mnemonic (optional)"
/>
<Mnemonic/>
</div>
Expand Down
17 changes: 15 additions & 2 deletions src/containers/KeyInfo/Continue.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as PropTypes from 'prop-types';
import { ValidateMnemonicSaved } from './_validation';
import { connect } from 'react-redux';
import Button from '../../components/Button';
import React from 'react';

Expand All @@ -7,10 +9,14 @@ const Continue = (props) => {
props.history.push('/dashboard/wallet');
};

const disabled = (
ValidateMnemonicSaved(props.saved).message !== ''
);

return (
<Button
className="btn button-primary"
disabled={false}
disabled={disabled}
inProgress={false}
type="button"
value="Continue"
Expand All @@ -23,6 +29,13 @@ Continue.propTypes = {
history: PropTypes.shape({
push: PropTypes.func.isRequired,
}).isRequired,
saved: PropTypes.bool.isRequired,
};

const stateToProps = (state) => {
return {
saved: state.keys.post.mnemonic.saved,
};
};

export default Continue;
export default connect(stateToProps, null)(Continue);
Loading

0 comments on commit df6c8fc

Please sign in to comment.