Skip to content

Commit

Permalink
Merge pull request #3444 from LiskHQ/feature-sdk-v5
Browse files Browse the repository at this point in the history
Change api to support Lisk SDK v5 - Closes #3288
  • Loading branch information
reyraa authored Apr 16, 2021
2 parents 53f72c6 + 0c37e8e commit 6faaba1
Show file tree
Hide file tree
Showing 483 changed files with 45,936 additions and 9,884 deletions.
35 changes: 22 additions & 13 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,34 @@
"beforeEach": true,
"afterEach": true,
"ipc": true,
"PRODUCTION": true,
"TEST": true,
"jest": true,
"expect": true
"expect": true,
"PRODUCTION": true
},
"env": {
"es2020": true,
"browser": true,
"node": true
},
"settings": {
"import/resolver" : {
"alias" : {
"map" : [
["@store", "./src/store"],
["@utils", "./src/utils/"],
["@api", "./src/utils/api/"],
["@actions", "./src/store/actions"],
["@constants", "./src/constants/"],
["@shared", "./src/components/shared"],
["@screens", "./src/components/screens/"],
["@toolbox", "./src/components/toolbox/"]
],
"extensions": [".js"]
}
}
},
"rules": {
"import/no-cycle": "error",
"import/named": "off",
"jsx-a11y/alt-text": "off",
"jsx-a11y/anchor-is-valid": "off",
Expand Down Expand Up @@ -70,16 +88,7 @@
"react/prop-types": "off",
"no-plusplus": "off",
"no-underscore-dangle": "off",
"import/no-extraneous-dependencies": ["error", {
"devDependencies": [
"./src/**/*.test.js",
"./test/**/*.js",
"./src/**/*.stories.js",
"./src/tests.js",
"./src/i18n-scanner.js"
]
}
],
"import/no-extraneous-dependencies": "off",
"linebreak-style": 0,
"no-param-reassign": "off",
"complexity": ["error", 10],
Expand Down
133 changes: 1 addition & 132 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,136 +88,7 @@ pipeline {
}
}
}
},
"cypress": {
dir('lisk') {
checkout([$class: 'GitSCM',
branches: [[name: "${params.LISK_CORE_VERSION}" ]],
userRemoteConfigs: [[url: 'https://github.com/LiskHQ/lisk-core']]])
}
dir('lisk-service') {
checkout([$class: 'GitSCM',
branches: [[name: "${params.LISK_SERVICE_VERSION}" ]],
userRemoteConfigs: [[url: 'https://github.com/LiskHQ/lisk-service']]])
sh '''
make build-core
make build-gateway
make build-template
make build-tests
'''
}
withCredentials([string(credentialsId: 'lisk-hub-testnet-passphrase', variable: 'TESTNET_PASSPHRASE'), string(credentialsId: 'lisk-hub-cypress-record-key', variable: 'CYPRESS_RECORD_KEY')]) {
ansiColor('xterm') {
wrap([$class: 'Xvfb', parallelBuild: true, autoDisplayName: true]) {
nvm(getNodejsVersion()) {
sh '''#!/bin/bash -xe
rm -rf $WORKSPACE/$BRANCH_NAME/
cp -rf $WORKSPACE/lisk/docker/ $WORKSPACE/$BRANCH_NAME/
cp $WORKSPACE/test/dev_blockchain.db.gz $WORKSPACE/$BRANCH_NAME/dev_blockchain.db.gz
cd $WORKSPACE/$BRANCH_NAME
cp .env.development .env
sed -i -r -e "s/ENV_LISK_VERSION=.*$/ENV_LISK_VERSION=$LISK_CORE_IMAGE_VERSION/" .env
sed -i -r -e '/ports:/,+2d' docker-compose.yml
# random port assignment
cat <<EOF >docker-compose.override.yml
version: "3"
services:
lisk:
ports:
- 4000:4000
environment:
- LISK_CONSOLE_LOG_LEVEL=debug
EOF
rm -rf $WORKSPACE/$BRANCH_NAME-service/
cp -rf $WORKSPACE/lisk-service/docker/ $WORKSPACE/$BRANCH_NAME-service/
ENV_LISK_VERSION="$LISK_CORE_IMAGE_VERSION" make coldstart
cd -
cd $WORKSPACE/$BRANCH_NAME-service/
# TODO: use random port when the tests support it
cat <<EOF >docker-compose.override.yml
version: "3"
services:
gateway:
ports:
- 127.0.0.1:9901:9901
EOF
cat <<EOF >custom.env
LISK_CORE_HTTP=http://10.127.0.1:4000
LISK_CORE_WS=ws://10.127.0.1:4000
EOF
sed -i '/compose := docker-compose/a\\\t-f docker-compose.override.yml \\\\' Makefile.jenkins
sed -i 's/docker-compose.testnet.yml/docker-compose.custom.yml/' Makefile.jenkins
ENABLE_HTTP_API='http-version1,http-version1-compat,http-status,http-test' \
ENABLE_WS_API='rpc,rpc-v1,blockchain,rpc-test' \
make -f Makefile.jenkins up
ready=1
retries=0
set +e
while [ $ready -ne 0 ]; do
curl --fail --verbose http://127.0.0.1:9901/api/v1/blocks
ready=$?
sleep 10
let retries++
if [ $retries = 6 ]; then
break
fi
done
set -e
if [ $retries -ge 6 ]; then
exit 1
fi
cd -
npm run serve -- $WORKSPACE/app/build -p 5650 -a 127.0.0.1 &>server.log &
export CYPRESS_baseUrl=http://127.0.0.1:5650/#/
export CYPRESS_coreUrl=http://127.0.0.1:4000
export CYPRESS_serviceUrl=http://127.0.0.1:9901
set +e
set -o pipefail
npm run cypress:run -- --record |tee cypress.log
ret=$?
# this is to save on cypress credits
if [ $ret -ne 0 ]; then
FAILED_TESTS="$( awk '/Spec/{f=1}f' cypress.log |grep --only-matching '✖ .*.feature' |awk '{ print "test/cypress/features/"$2 }' |xargs| tr -s ' ' ',' )"
cd $WORKSPACE/$BRANCH_NAME
make coldstart
sleep 10
cd -
npm run cypress:run -- --record --spec $FAILED_TESTS |tee cypress.log
ret=$?
fi
exit $ret
'''
}
}
}
}
},
"percy": {
script {
if(params.SKIP_PERCY){
echo 'Skipping percy run as requested.'
} else {
ansiColor('xterm') {
nvm(getNodejsVersion()) {
withCredentials([string(credentialsId: 'PERCY_TOKEN', variable: 'PERCY_TOKEN')]) {
sh 'npm run percy'
}
}
}
}
}
},
}
)
}
}
Expand All @@ -241,13 +112,11 @@ EOF
fixed {
script {
build_info = getBuildInfo()
liskSlackSend('good', "Recovery: build ${build_info} was successful.")
}
}
failure {
script {
build_info = getBuildInfo()
liskSlackSend('danger', "Build ${build_info} failed (<${env.BUILD_URL}/console|console>, <${env.BUILD_URL}/changes|changes>)")
}
}
cleanup {
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lisk-desktop",
"version": "2.0.0-beta.2",
"version": "2.0.0-alpha.6",
"productName": "Lisk",
"description": "Lisk",
"main": "./build/main.js",
Expand Down
6 changes: 3 additions & 3 deletions app/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ipcMain } from 'electron'; // eslint-disable-line import/no-extraneous-dependencies
import Lisk from '@liskhq/lisk-client'; // eslint-disable-line
import { cryptography, transactions } from '@liskhq/lisk-client'; // eslint-disable-line

export const createCommand = (command, fn) => {
ipcMain.on(`${command}.request`, (event, ...args) => {
Expand All @@ -12,7 +12,7 @@ export const createCommand = (command, fn) => {

export const isValidAddress = address => address.length > 2 && address.length < 22 && address[address.length - 1] === 'L';

export const getBufferToHex = buffer => Lisk.cryptography.bufferToHex(buffer);
export const getBufferToHex = buffer => cryptography.bufferToHex(buffer);

export const getTransactionBytes = transaction =>
Lisk.transaction.utils.getTransactionBytes(transaction);
transaction.getBytes(transaction);
19 changes: 0 additions & 19 deletions config/liskSdkFix.js

This file was deleted.

126 changes: 0 additions & 126 deletions config/readBigUInt64BE.js

This file was deleted.

Loading

0 comments on commit 6faaba1

Please sign in to comment.