Skip to content

Commit

Permalink
Merge pull request #1846 from MyCryptoHQ/hotfix-may-24
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
dternyak authored May 25, 2018
2 parents 5c01fb1 + 5200bf5 commit 675d01a
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 34 deletions.
70 changes: 50 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,65 @@
dist: trusty
sudo: required

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:
yarn: true
directories:
- node_modules
- $HOME/.cache/electron
- $HOME/.cache/electron-builder

services:
- docker
before_cache:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
rm -rf $HOME/.cache/electron-builder/wine
fi
before_install:
- export CHROME_BIN=chromium-browser
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
# uncomment once integration tests are included in CI
# - docker pull dternyak/eth-priv-to-addr:latest
- sudo apt-get install libusb-1.0
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
export CHROME_BIN=chromium-browser
export DISPLAY=:99.0
sh -e /etc/init.d/xvfb start
# 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:
- npm install --silent
- yarn --silent

jobs:
include:
- stage: test
script: npm run prettier:diff
- stage: test
script: npm run test:coverage -- --maxWorkers=2 && npm run report-coverage
- stage: test
script: npm run tslint && npm run tscheck && npm run freezer && npm run freezer:validate
script:
- |
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
npm run prettier:diff
npm run test:coverage -- --maxWorkers=2
npm run report-coverage
npm run tslint
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:
email:
on_success: never
on_failure: never
on_failure: never
4 changes: 2 additions & 2 deletions common/config/data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ export const N_FACTOR = 8192;

// Bricks the app once this date has been exceeded. Remember to update these 2
// 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
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.
// Type can be primary, warning, danger, success, info, or blank for grey.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,36 @@ class InteractExplorerClass extends Component<Props, State> {
{/* TODO: Use reusable components with validation */}
{selectedFunction.contract.inputs.map(input => {
const { type, name } = input;

const inputState = this.state.inputs[name];
return (
<div key={name} className="input-group-wrapper InteractExplorer-func-in">
<label className="input-group">
<div className="input-group-header">{name + ' ' + type}</div>
<Input
className="InteractExplorer-func-in-input"
isValid={!!(inputs[name] && inputs[name].rawData)}
name={name}
value={(inputs[name] && inputs[name].rawData) || ''}
onChange={this.handleInputChange}
/>
{type === 'bool' ? (
<Dropdown
options={[{ value: false, label: 'false' }, { value: true, label: 'true' }]}
value={
inputState
? {
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>
</div>
);
Expand Down Expand Up @@ -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>) => {
const rawValue: string = ev.currentTarget.value;
const isArr = rawValue.startsWith('[') && rawValue.endsWith(']');
Expand Down
4 changes: 2 additions & 2 deletions common/libs/contracts/ABIFunction.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import abi from 'ethereumjs-abi';
import { toChecksumAddress, addHexPrefix } from 'ethereumjs-util';
import { toChecksumAddress, addHexPrefix, stripHexPrefix } from 'ethereumjs-util';
import BN from 'bn.js';
import {
FuncParams,
Expand Down Expand Up @@ -97,7 +97,7 @@ export default class AbiFunction {

private parsePreEncodedValue = (type: string, value: any) => {
if (type === 'bytes') {
return Buffer.from(value, 'hex');
return Buffer.from(stripHexPrefix(value), 'hex');
}
return BN.isBN(value) ? value.toString() : value;
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "MyCrypto",
"author": "MyCryptoHQ",
"version": "1.0.0",
"electron-version": "1.0.0-alpha.3",
"version": "1.0.1",
"electron-version": "1.0.1-alpha.4",
"main": "main.js",
"description": "MyCrypto web and electron app",
"repository": "https://github.com/MyCryptoHQ/MyCrypto",
Expand Down

0 comments on commit 675d01a

Please sign in to comment.