Merge pull request #1846 from MyCryptoHQ/hotfix-may-24

Release 1.0.1
This commit is contained in:
Daniel Ternyak 2018-05-24 19:44:49 -05:00 committed by GitHub
commit 675d01a4e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 93 additions and 34 deletions

View File

@ -1,33 +1,63 @@
dist: trusty
sudo: required
language: node_js language: node_js
matrix:
include:
- os: osx
osx_image: xcode9.3
env:
- ELECTRON_CACHE=$HOME/.cache/electron
- ELECTRON_BUILDER_CACHE=$HOME/.cache/electron-builder
- os: linux
dist: trusty
sudo: required
services: docker
cache: cache:
yarn: true
directories: directories:
- node_modules - node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder
services: before_cache:
- docker - |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
rm -rf $HOME/.cache/electron-builder/wine
fi
before_install: before_install:
- export CHROME_BIN=chromium-browser - |
- export DISPLAY=:99.0 if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
- sh -e /etc/init.d/xvfb start export CHROME_BIN=chromium-browser
# uncomment once integration tests are included in CI export DISPLAY=:99.0
# - docker pull dternyak/eth-priv-to-addr:latest sh -e /etc/init.d/xvfb start
- sudo apt-get install libusb-1.0 # uncomment once integration tests are included in CI
# docker pull dternyak/eth-priv-to-addr:latest
sudo apt-get install libusb-1.0
fi
install: install:
- npm install --silent - yarn --silent
jobs: script:
include: - |
- stage: test if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
script: npm run prettier:diff npm run prettier:diff
- stage: test npm run test:coverage -- --maxWorkers=2
script: npm run test:coverage -- --maxWorkers=2 && npm run report-coverage npm run report-coverage
- stage: test npm run tslint
script: npm run tslint && npm run tscheck && npm run freezer && npm run freezer:validate npm run tscheck
npm run freezer
npm run freezer:validate
fi
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
npm run build:electron
ls -la dist/electron-builds
fi
notifications: notifications:
email: email:

View File

@ -16,9 +16,9 @@ export const N_FACTOR = 8192;
// Bricks the app once this date has been exceeded. Remember to update these 2 // Bricks the app once this date has been exceeded. Remember to update these 2
// whenever making a new app release. // whenever making a new app release.
// It is currently set to: 05/25/2018 @ 12:00am (UTC) // It is currently set to: Wednesday, July 25, 2018 12:00:00 AM (GMT)
// TODO: Remove me once app alpha / release candidates are done // TODO: Remove me once app alpha / release candidates are done
export const APP_ALPHA_EXPIRATION = 1527206400000; export const APP_ALPHA_EXPIRATION = 1532476800000;
// Displays at the top of the site, make message empty string to remove. // Displays at the top of the site, make message empty string to remove.
// Type can be primary, warning, danger, success, info, or blank for grey. // Type can be primary, warning, danger, success, info, or blank for grey.

View File

@ -109,18 +109,36 @@ class InteractExplorerClass extends Component<Props, State> {
{/* TODO: Use reusable components with validation */} {/* TODO: Use reusable components with validation */}
{selectedFunction.contract.inputs.map(input => { {selectedFunction.contract.inputs.map(input => {
const { type, name } = input; const { type, name } = input;
const inputState = this.state.inputs[name];
return ( return (
<div key={name} className="input-group-wrapper InteractExplorer-func-in"> <div key={name} className="input-group-wrapper InteractExplorer-func-in">
<label className="input-group"> <label className="input-group">
<div className="input-group-header">{name + ' ' + type}</div> <div className="input-group-header">{name + ' ' + type}</div>
<Input {type === 'bool' ? (
className="InteractExplorer-func-in-input" <Dropdown
isValid={!!(inputs[name] && inputs[name].rawData)} options={[{ value: false, label: 'false' }, { value: true, label: 'true' }]}
name={name} value={
value={(inputs[name] && inputs[name].rawData) || ''} inputState
onChange={this.handleInputChange} ? {
/> label: inputState.rawData,
value: inputState.parsedData as any
}
: undefined
}
clearable={false}
onChange={({ value }: { value: boolean }) => {
this.handleBooleanDropdownChange({ value, name });
}}
/>
) : (
<Input
className="InteractExplorer-func-in-input"
isValid={!!(inputs[name] && inputs[name].rawData)}
name={name}
value={(inputs[name] && inputs[name].rawData) || ''}
onChange={this.handleInputChange}
/>
)}
</label> </label>
</div> </div>
); );
@ -244,6 +262,17 @@ class InteractExplorerClass extends Component<Props, State> {
} }
} }
private handleBooleanDropdownChange = ({ value, name }: { value: boolean; name: string }) => {
this.setState({
inputs: {
...this.state.inputs,
[name as any]: {
rawData: value.toString(),
parsedData: value
}
}
});
};
private handleInputChange = (ev: React.FormEvent<HTMLInputElement>) => { private handleInputChange = (ev: React.FormEvent<HTMLInputElement>) => {
const rawValue: string = ev.currentTarget.value; const rawValue: string = ev.currentTarget.value;
const isArr = rawValue.startsWith('[') && rawValue.endsWith(']'); const isArr = rawValue.startsWith('[') && rawValue.endsWith(']');

View File

@ -1,5 +1,5 @@
import abi from 'ethereumjs-abi'; import abi from 'ethereumjs-abi';
import { toChecksumAddress, addHexPrefix } from 'ethereumjs-util'; import { toChecksumAddress, addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
import BN from 'bn.js'; import BN from 'bn.js';
import { import {
FuncParams, FuncParams,
@ -97,7 +97,7 @@ export default class AbiFunction {
private parsePreEncodedValue = (type: string, value: any) => { private parsePreEncodedValue = (type: string, value: any) => {
if (type === 'bytes') { if (type === 'bytes') {
return Buffer.from(value, 'hex'); return Buffer.from(stripHexPrefix(value), 'hex');
} }
return BN.isBN(value) ? value.toString() : value; return BN.isBN(value) ? value.toString() : value;
}; };

View File

@ -1,8 +1,8 @@
{ {
"name": "MyCrypto", "name": "MyCrypto",
"author": "MyCryptoHQ", "author": "MyCryptoHQ",
"version": "1.0.0", "version": "1.0.1",
"electron-version": "1.0.0-alpha.3", "electron-version": "1.0.1-alpha.4",
"main": "main.js", "main": "main.js",
"description": "MyCrypto web and electron app", "description": "MyCrypto web and electron app",
"repository": "https://github.com/MyCryptoHQ/MyCrypto", "repository": "https://github.com/MyCryptoHQ/MyCrypto",