From 352473ac9f5b87745261e6490e46293a72af6275 Mon Sep 17 00:00:00 2001 From: HenryNguyen5 Date: Mon, 21 May 2018 14:11:08 -0400 Subject: [PATCH 1/5] Strip hex prefix for bytes inputs (#1811) --- common/libs/contracts/ABIFunction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/libs/contracts/ABIFunction.ts b/common/libs/contracts/ABIFunction.ts index 54502edd4a0..3240e652ad7 100644 --- a/common/libs/contracts/ABIFunction.ts +++ b/common/libs/contracts/ABIFunction.ts @@ -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; }; From 693e1972e5b21d929d6a26b05697282d135adff0 Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Thu, 24 May 2018 17:10:57 -0500 Subject: [PATCH 2/5] Update Electron Expiration (#1844) --- common/config/data.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/config/data.tsx b/common/config/data.tsx index 5e3e9b0f15d..541c8d311aa 100644 --- a/common/config/data.tsx +++ b/common/config/data.tsx @@ -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. From 28da18e84a10c7e7bc5e4fb809ccfebf072239a7 Mon Sep 17 00:00:00 2001 From: HenryNguyen5 Date: Thu, 24 May 2018 19:22:33 -0400 Subject: [PATCH 3/5] Add dropdown for boolean inputs (#1845) --- .../components/InteractExplorer/index.tsx | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/common/containers/Tabs/Contracts/components/Interact/components/InteractExplorer/index.tsx b/common/containers/Tabs/Contracts/components/Interact/components/InteractExplorer/index.tsx index ec0cc59d662..8c9687d47f1 100644 --- a/common/containers/Tabs/Contracts/components/Interact/components/InteractExplorer/index.tsx +++ b/common/containers/Tabs/Contracts/components/Interact/components/InteractExplorer/index.tsx @@ -109,18 +109,36 @@ class InteractExplorerClass extends Component { {/* TODO: Use reusable components with validation */} {selectedFunction.contract.inputs.map(input => { const { type, name } = input; - + const inputState = this.state.inputs[name]; return (
); @@ -244,6 +262,17 @@ class InteractExplorerClass extends Component { } } + 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) => { const rawValue: string = ev.currentTarget.value; const isArr = rawValue.startsWith('[') && rawValue.endsWith(']'); From 61fa74492719a76beaf30f29e70c3e06bae7761d Mon Sep 17 00:00:00 2001 From: Daniel Ternyak Date: Thu, 24 May 2018 18:28:17 -0500 Subject: [PATCH 4/5] Update Versions --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ac0440dfec6..ad811f33c41 100644 --- a/package.json +++ b/package.json @@ -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", From 5200bf54ace8b3caf4a30a912edaefab7434d5a8 Mon Sep 17 00:00:00 2001 From: Danny Skubak Date: Tue, 22 May 2018 14:04:10 -0400 Subject: [PATCH 5/5] Add Electron Build to Travis (#1830) * introduce build matrix to travis config * remove branch exclusion * trigger mycryptobuild --- .travis.yml | 70 ++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index b322a69ab64..0b22ddef750 100644 --- a/.travis.yml +++ b/.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 \ No newline at end of file + on_failure: never