mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-02 22:34:44 +00:00
commit
675d01a4e6
70
.travis.yml
70
.travis.yml
@ -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
|
||||
|
@ -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.
|
||||
|
@ -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>
|
||||
);
|
||||
@ -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(']');
|
||||
|
@ -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,
|
||||
@ -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;
|
||||
};
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user