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

Commit

Permalink
Merge pull request #1658 from ArkEcosystem/develop
Browse files Browse the repository at this point in the history
chore: merge develop into master
  • Loading branch information
alexbarnsley committed Feb 10, 2020
2 parents 2bdab6c + bda0e3a commit 32b987c
Show file tree
Hide file tree
Showing 199 changed files with 28,173 additions and 2,795 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Format

on:
pull_request:
paths:
- '**.css'
- '**.js'
- '**.ts'
- '**.vue'

jobs:
eslint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Update System
run: sudo apt-get update

- name: Ledger
run: sudo apt-get install libudev-dev libusb-1.0-0-dev

- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile && npm rebuild

- name: Run eslint
run: yarn lint:fix

- uses: stefanzweifel/git-auto-commit-action@v2.1.0
with:
commit_message: "style: resolve style guide violations"
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
55 changes: 26 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Test & Build
on:
push:
branches:
- 'master'
- 'develop'
- "master"
- "develop"
pull_request:
types: [ready_for_review, synchronize, opened]

Expand Down Expand Up @@ -44,14 +44,12 @@ jobs:
run: yarn lint

- name: Test
run: yarn test:unit --coverage
run: node --max-old-space-size=4096 ./node_modules/.bin/jest --config __tests__/unit.jest.conf.js __tests__/unit/ --logHeapUsage --coverage

- name: Codecov
run: ./node_modules/.bin/codecov --token=${{ secrets.CODECOV_TOKEN }}

build-linux:
needs: lint-unit

runs-on: ubuntu-latest

strategy:
Expand Down Expand Up @@ -80,32 +78,33 @@ jobs:
run: sudo apt-get install libudev-dev libusb-1.0-0-dev

- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile && npm rebuild
run: yarn global add node-gyp && yarn install --frozen-lockfile

- name: Re-build bcrypto
run: cd node_modules/bcrypto && npm install && cd ../../

- name: Build
run: node .electron-vue/build.js && node ./node_modules/electron-builder/out/cli/cli.js --linux
run: yarn build:linux

# - name: Upload .AppImage
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-linux-2.7.0.AppImage
# path: build/target/ark-desktop-wallet-linux-x86_64-2.7.0.AppImage
# name: ark-desktop-wallet-linux-2.8.0.AppImage
# path: build/target/ark-desktop-wallet-linux-x86_64-2.8.0.AppImage

# - name: Upload .tar.gz
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-linux-2.7.0.tar.gz
# path: build/target/ark-desktop-wallet-linux-x64-2.7.0.tar.gz
# name: ark-desktop-wallet-linux-2.8.0.tar.gz
# path: build/target/ark-desktop-wallet-linux-x64-2.8.0.tar.gz

- name: Upload .deb
uses: actions/upload-artifact@master
with:
name: ark-desktop-wallet-linux-2.7.0.deb
path: build/target/ark-desktop-wallet-linux-amd64-2.7.0.deb
name: ark-desktop-wallet-linux-2.8.0.deb
path: build/target/ark-desktop-wallet-linux-amd64-2.8.0.deb

build-macOS:
needs: lint-unit

runs-on: macOS-latest

strategy:
Expand All @@ -128,26 +127,24 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile && npm rebuild
run: yarn global add node-gyp && yarn install --frozen-lockfile

- name: Build
run: node .electron-vue/build.js && node ./node_modules/electron-builder/out/cli/cli.js --mac
run: yarn build:mac

# - name: Upload .zip
# uses: actions/upload-artifact@master
# with:
# name: ark-desktop-wallet-mac-2.7.0.zip
# path: build/target/ark-desktop-wallet-mac-2.7.0.zip
# name: ark-desktop-wallet-mac-2.8.0.zip
# path: build/target/ark-desktop-wallet-mac-2.8.0.zip

- name: Upload .dmg
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v1
with:
name: ark-desktop-wallet-mac-2.7.0.dmg
path: build/target/ark-desktop-wallet-mac-2.7.0.dmg
name: ark-desktop-wallet-mac-2.8.0.dmg
path: build/target/ark-desktop-wallet-mac-2.8.0.dmg

build-windows:
needs: lint-unit

runs-on: windows-latest

strategy:
Expand All @@ -163,15 +160,15 @@ jobs:
node-version: ${{ matrix.node-version }}

- name: Install
run: yarn global add node-gyp && yarn install --frozen-lockfile && npm rebuild
run: yarn global add node-gyp && yarn install --frozen-lockfile
shell: cmd

- name: Build
run: node .electron-vue/build.js && node ./node_modules/electron-builder/out/cli/cli.js --win --x64 --ia32
run: yarn build:win
shell: cmd

- name: Upload .exe
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v1
with:
name: ark-desktop-wallet-win-2.7.0.exe
path: build/target/ark-desktop-wallet-win-2.7.0.exe
name: ark-desktop-wallet-win-2.8.0.exe
path: build/target/ark-desktop-wallet-win-2.8.0.exe
2 changes: 1 addition & 1 deletion .lintstagedrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"*.{js,vue}": ["npm run lint:fix", "git add"]
"*.{js,vue}": ["npm run lint:fix"]
}
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ before_script:
script:
- |
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
yarn build:mac
yarn build:mac:publish
elif [ "$TRAVIS_OS_NAME" == "windows" ]; then
yarn build:win
yarn build:win:publish
else
yarn build:linux
yarn build:linux:publish
fi
after_script:
Expand Down
6 changes: 2 additions & 4 deletions __tests__/unit.jest.conf.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
const path = require('path')

module.exports = {
verbose: false,
globals: {
__static: __dirname
},
rootDir: path.resolve(__dirname, '../'),
rootDir: require('path').resolve(__dirname, '../'),
moduleFileExtensions: [
'js',
'json',
Expand All @@ -14,8 +12,8 @@ module.exports = {
moduleNameMapper: {
'^@tailwind': '<rootDir>/tailwind.js',
'^@package.json$': '<rootDir>/package.json',
'^@config': '<rootDir>/config/index.js',
'^@config/(.*)$': '<rootDir>/config/$1',
'^@config': '<rootDir>/config/index.js',
'^@/(.*)$': '<rootDir>/src/renderer/$1',
'^@tests/(.*)$': '<rootDir>/__tests__/$1',
vue$: '<rootDir>/node_modules/vue/dist/vue.common.js'
Expand Down
16 changes: 16 additions & 0 deletions __tests__/unit/__fixtures__/models/transaction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export default {
id: '022d918ed3b2174c4e288c675805fa2e85547cef8ba2020e54ca84c0c4b9b3ba',
blockId: '9014855312368837997',
version: 1,
type: 0,
typeGroup: 1,
amount: 1,
fee: 10000000,
sender: 'AJjv7WztjJNYHrLAeveG5NgHWp6699ZJwD',
senderPublicKey: '02275d8577a0ec2b75fc8683282d53c5db76ebc54514a80c2854e419b793ea259a',
recipientId: 'AdXbS4GKvV6TZVHrNzcYSQKfpenQnFGTxK',
signature: '304402206db4ffcdff1c6eb19ecdf0f83cf528a34673eac57defbf25298a6f25f9791fd602206f12834a752c11d749c7450c63550e2c09ff01092c23f67941d6695faaa9e0a9',
confirmations: 444027,
timestamp: 59960304,
nonce: '3'
}
17 changes: 10 additions & 7 deletions __tests__/unit/__fixtures__/services/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ delegates.v2 = [

const transactions = {
data: [
{ id: 1, amount: 100000, fee: 10000000, timestamp: { epoch: 47848091, human: '2018-09-26T08:08:11.000Z' }, sender: 'address1', recipient: 'address2' },
{ id: 2, amount: 200000, fee: 10000000, timestamp: { epoch: 47809625, human: '2018-09-25T21:27:05.000Z' }, sender: 'address2', recipient: 'address3' },
{ id: 3, amount: 300000, fee: 10000000, timestamp: { epoch: 47796863, human: '2018-09-25T17:54:23.000Z' }, sender: 'address3', recipient: 'address3' }
{ id: 1, type: 0, amount: 100000, fee: 10000000, timestamp: { epoch: 47848091, human: '2018-09-26T08:08:11.000Z' }, sender: 'address1', recipient: 'address2' },
{ id: 2, type: 0, amount: 200000, fee: 10000000, timestamp: { epoch: 47809625, human: '2018-09-25T21:27:05.000Z' }, sender: 'address2', recipient: 'address3' },
{ id: 3, type: 0, amount: 300000, fee: 10000000, timestamp: { epoch: 47796863, human: '2018-09-25T17:54:23.000Z' }, sender: 'address3', recipient: 'address3' },
{ id: 3, type: 1, amount: 0, fee: 10000000, timestamp: { epoch: 47796863, human: '2018-09-25T17:54:23.000Z' }, sender: 'address3', recipient: 'address3' }
]
}

Expand Down Expand Up @@ -65,10 +66,12 @@ const staticFeeResponses = {
delegateRegistration: 2500000000,
vote: 100000000,
multiSignature: 500000000,
ipfs: 0,
timelockTransfer: 0,
multiPayment: 0,
delegateResignation: 0
ipfs: 500000000,
multiPayment: 100000000,
delegateResignation: 2500000000,
htlcLock: 100000000,
htlcClaim: 100000000,
htlcRefund: 100000000
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion __tests__/unit/__mocks__/@/services/wallet.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
import WalletServiceOriginal from '../../../../../src/renderer/services/wallet'

export default {
generate: jest.fn(() => {
return {
address: 'Address',
passphrase: 'passphrase'
}
}),
canResignBusiness: jest.fn(() => false),
getAddressFromPublicKey: jest.fn(address => `public key of ${address}`),
getPublicKeyFromPassphrase: jest.fn(passphrase => `public key of ${passphrase}`),
getPublicKeyFromMultiSignatureAsset: jest.fn(multisignature => 'public key of multisignature'),
generateSecondPassphrase: jest.fn(() => 'second-passphrase'),
validateAddress: jest.fn(() => true),
validatePassphrase: jest.fn(() => true),
validateUsername: jest.fn(WalletServiceOriginal.validateUsername),
verifyPassphrase: jest.fn(() => true),
isBip39Passphrase: jest.fn(() => true)
isBip39Passphrase: jest.fn(() => true),
isNeoAddress: jest.fn(() => false)
}
12 changes: 5 additions & 7 deletions __tests__/unit/__mocks__/@arkecosystem/ledger-transport.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
export default class {
export class ARKTransport {
constructor () {
this.getAddress = jest.fn(() => ({
address: 'DLWeBuwSBFYtUFj8kFB8CFswfvN2ht3yKn',
publicKey: '0278a28d0eac9916ef46613d9dbac706acc218e64864d4b4c1fcb0c759b6205b2b'
}))
this.signTransaction = jest.fn(() => ({ signature: 'SIGNATURE' }))
this.getAppConfiguration = jest.fn()
this.getPublicKey = jest.fn(() => '0278a28d0eac9916ef46613d9dbac706acc218e64864d4b4c1fcb0c759b6205b2b')
this.signMessage = jest.fn(() => 'SIGNATURE')
this.signTransaction = jest.fn(() => 'SIGNATURE')
this.getVersion = jest.fn(() => '1.0.0')
}
}

0 comments on commit 32b987c

Please sign in to comment.