Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Commit

Permalink
upgrade all packages using yarn upgrade --latest
Browse files Browse the repository at this point in the history
issue: #60
  • Loading branch information
Jaguar0625 committed Jul 22, 2019
1 parent ec8923a commit b1407d7
Show file tree
Hide file tree
Showing 112 changed files with 10,592 additions and 7,958 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/
__pycache__/
catapult-*.log*
npm-*.log*
yarn-*.log*
.idea
.vscode/
typings.json
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: node_js

node_js:
- "8"
- "9"
- "10"

addons:
apt:
Expand All @@ -24,4 +24,4 @@ cache: yarn

before_script: sh yarn_setup.sh

script: cd ${SUBPROJECT} && yarn run test:travis
script: cd ${SUBPROJECT} && yarn run lint && yarn run test:travis
22 changes: 17 additions & 5 deletions catapult-sdk/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ env:
extends: airbnb
parserOptions:
sourceType: module
plugins:
- sort-requires

rules:
indent:
Expand All @@ -31,6 +29,12 @@ rules:
- error
- code: 140

nonblock-statement-body-position:
- error
- below
implicit-arrow-linebreak:
- off

no-tabs:
- off
no-bitwise:
Expand Down Expand Up @@ -88,6 +92,17 @@ rules:
Object: object
String: string

import/order:
- error
- newlines-between: never
groups:
- index
- sibling
- parent
- internal
- external
- builtin

import/extensions:
- error
- never
Expand All @@ -99,6 +114,3 @@ rules:
- error
import/named:
- error

sort-requires/sort-requires:
- 2
39 changes: 19 additions & 20 deletions catapult-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"build": "ncp src/ _build && cross-env BABEL_ENV=production babel src -d _build_browser --source-maps",
"rebuild": "npm run clean && npm run build",
"test": "mocha --full-trace --recursive",
"test:coverage": "nyc yarn test && nyc report --reporter=text-lcov",
"test:coverage": "nyc npm test && nyc report --reporter=text-lcov",
"test:jenkins": "cross-env JUNIT_REPORT_PATH=test-results.xml mocha --reporter mocha-jenkins-reporter --forbid-only --full-trace --recursive test || exit 0",
"test:travis": "nyc npm run test && nyc report --reporter=text-lcov | coveralls",
"test:travis": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
"lint": "eslint src test",
"lint:jenkins": "eslint -o tests.catapult.lint.xml -f junit src test || exit 0"
},
Expand All @@ -19,28 +19,27 @@
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-core": "^6.26.3",
"babel-plugin-transform-inline-environment-variables": "^6.8.0",
"babel-preset-env": "^1.6.1",
"chai": "^4.1.2",
"coveralls": "^3.0.1",
"cross-env": "^5.1.3",
"eslint": "^4.18.2",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-sort-requires": "^2.1.0",
"mocha": "^5.0.1",
"mocha-jenkins-reporter": "^0.3.10",
"babel-preset-env": "^1.7.0",
"chai": "^4.2.0",
"coveralls": "^3.0.5",
"cross-env": "^5.2.0",
"eslint": "^6.0.1",
"eslint-config-airbnb": "^17.1.1",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.14.2",
"mocha": "^6.1.4",
"mocha-jenkins-reporter": "^0.4.1",
"ncp": "^2.0.0",
"nyc": "^11.8.0",
"rimraf": "^2.6.2"
"nyc": "^14.1.1",
"rimraf": "^2.6.3"
},
"dependencies": {
"js-sha3": "^0.7.0",
"ripemd160": "^2.0.1",
"tweetnacl": "^1.0.0"
"js-sha3": "^0.8.0",
"ripemd160": "^2.0.2",
"tweetnacl": "^1.0.1"
},
"nyc": {
"exclude": [
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/src/auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*/

/** @module auth/auth */
const PacketParser = require('../parser/PacketParser');
const verifyPeer = require('./verifyPeer');
const VerifyResult = require('./VerifyResult');
const PacketParser = require('../parser/PacketParser');

/**
* An error that indicates a failed verification handshake.
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/src/auth/challenge.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*/

/** @module auth/challenge */
const crypto = require('crypto');
const packetHeader = require('../packet/header');
const PacketType = require('../packet/PacketType');
const { sign, verify } = require('../crypto/keyPair');
const crypto = require('crypto');

const sizes = {
header: packetHeader.size,
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/src/auth/verifyPeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
/** @module auth/verifyPeer */
const challengeHandler = require('./challenge');
const challengeParser = require('./challengeParser');
const EventEmitter = require('events');
const VerifyResult = require('./VerifyResult');
const EventEmitter = require('events');

class AuthPacketHandler {
constructor(serverSocket, clientKeyPair, serverPublicKey) {
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/src/crypto/keyPair.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
*/

/** @module crypto/keyPair */
const sha3Hasher = require('./sha3Hasher');
const arrayUtils = require('../utils/arrayUtils');
const convert = require('../utils/convert');
const nacl = require('../external/nacl_catapult');
const sha3Hasher = require('./sha3Hasher');

const Key_Size = 32;
const Signature_Size = 64;
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/src/modelBinary/ModelCodecBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@

/** @module modelBinary/ModelCodecBuilder */
const blockHeaderCodec = require('./blockHeaderCodec');
const SerializedSizeCalculator = require('../serializer/SerializedSizeCalculator');
const transactionCodec = require('./transactionCodec');
const verifiableEntityCodec = require('./verifiableEntityCodec');
const SerializedSizeCalculator = require('../serializer/SerializedSizeCalculator');

const constants = {
sizes: {
Expand Down
4 changes: 2 additions & 2 deletions catapult-sdk/src/modelBinary/transactionExtensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const crypto = require('../crypto/keyPair');
const serialize = require('./serialize');
const sha3Hasher = require('../crypto/sha3Hasher');
const sizes = require('./sizes');
const crypto = require('../crypto/keyPair');
const sha3Hasher = require('../crypto/sha3Hasher');

// serialize.toBuffer returns a nodejs buffer that does not copy any data when slicing
const serializeToBuffer = (codec, transaction) => serialize.toBuffer(codec, transaction).slice(sizes.transactionHeader);
Expand Down
6 changes: 3 additions & 3 deletions catapult-sdk/src/plugins/catapultModelSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ const accountLink = require('./accountLink');
const accountRestrictions = require('./accountRestrictions');
const aggregate = require('./aggregate');
const lock = require('./lock');
const ModelCodecBuilder = require('../modelBinary/ModelCodecBuilder');
const ModelFormatterBuilder = require('../model/ModelFormatterBuilder');
const ModelSchemaBuilder = require('../model/ModelSchemaBuilder');
const mosaic = require('./mosaic');
const multisig = require('./multisig');
const namespace = require('./namespace');
const receipts = require('./receipts');
const transfer = require('./transfer');
const ModelSchemaBuilder = require('../model/ModelSchemaBuilder');
const ModelFormatterBuilder = require('../model/ModelFormatterBuilder');
const ModelCodecBuilder = require('../modelBinary/ModelCodecBuilder');

const plugins = {
accountLink, accountRestrictions, aggregate, lock, mosaic, multisig, namespace, receipts, transfer
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/src/utils/arrayUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const arrayUtils = {
uint8View: input => {
if (ArrayBuffer === input.constructor)
return new Uint8Array(input); // note that wrapping an ArrayBuffer in an Uint8Array does not make a copy
else if (Uint8Array === input.constructor)
if (Uint8Array === input.constructor)
return input;

throw Error('unsupported type passed to uint8View');
Expand Down
1 change: 0 additions & 1 deletion catapult-sdk/src/utils/schemaFormatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
/** @module utils/schemaFormatter */
const SchemaType = require('./SchemaType');


// if 'definition' is a number, it is the type
// otherwise, it is an object with an optional type property (default type is none)
const getSchemaType = definition => ('number' === typeof definition ? definition : definition.type || SchemaType.none);
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/test/auth/auth_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const auth = require('../../src/auth/auth');
const test = require('./utils/authUtils');
const auth = require('../../src/auth/auth');
const VerifyResult = require('../../src/auth/VerifyResult');
const { expect } = require('chai');

Expand Down
4 changes: 2 additions & 2 deletions catapult-sdk/test/auth/challenge_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const test = require('./utils/authUtils');
const handler = require('../../src/auth/challenge');
const PacketType = require('../../src/packet/PacketType');
const test = require('./utils/authUtils');
const { expect } = require('chai');
const { verify } = require('../../src/crypto/keyPair');
const { expect } = require('chai');

describe('challenge', () => {
// region verify server challenges
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/test/auth/utils/authUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const crypto = require('crypto');
const PacketType = require('../../../src/packet/PacketType');
const test = require('../../testUtils');
const { sign } = require('../../../src/crypto/keyPair');
const crypto = require('crypto');

const Challenge_Size = 64;

Expand Down
4 changes: 2 additions & 2 deletions catapult-sdk/test/auth/verifyPeer_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const PacketType = require('../../src/packet/PacketType');
const test = require('./utils/authUtils');
const PacketType = require('../../src/packet/PacketType');
const verifyPeer = require('../../src/auth/verifyPeer');
const VerifyResult = require('../../src/auth/VerifyResult');
const { expect } = require('chai');
const { verify } = require('../../src/crypto/keyPair');
const { expect } = require('chai');

describe('verify peer', () => {
describe('verify server', () => {
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/test/binaryTestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const test = require('./testUtils');
const BinaryParser = require('../src/parser/BinaryParser');
const BinarySerializer = require('../src/serializer/BinarySerializer');
const test = require('./testUtils');
const { expect } = require('chai');

const binaryTestUtils = {
Expand Down
3 changes: 1 addition & 2 deletions catapult-sdk/test/plugins/accountLink_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
const EntityType = require('../../src/model/EntityType');
const ModelSchemaBuilder = require('../../src/model/ModelSchemaBuilder');
const test = require('../binaryTestUtils');
const { expect } = require('chai');

const accountLinkPlugin = require('../../src/plugins/accountLink');
const { expect } = require('chai');

describe('account link plugin', () => {
describe('register schema', () => {
Expand Down
5 changes: 2 additions & 3 deletions catapult-sdk/test/plugins/accountRestrictions_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
* along with Catapult. If not, see <http://www.gnu.org/licenses/>.
*/

const test = require('../binaryTestUtils');
const EntityType = require('../../src/model/EntityType');
const ModelSchemaBuilder = require('../../src/model/ModelSchemaBuilder');
const test = require('../binaryTestUtils');
const { expect } = require('chai');

const accountRestrictionsPlugin = require('../../src/plugins/accountRestrictions');
const { AccountRestrictionType } = require('../../src/plugins/accountRestrictions');
const { expect } = require('chai');

describe('account restrictions plugin', () => {
describe('account restriction types enumeration', () => {
Expand Down
4 changes: 1 addition & 3 deletions catapult-sdk/test/plugins/receipts_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
const ModelSchemaBuilder = require('../../src/model/ModelSchemaBuilder');
const ModelType = require('../../src/model/ModelType');
const schemaFormatter = require('../../src/utils/schemaFormatter');
const { expect } = require('chai');

const receiptsPlugin = require('../../src/plugins/receipts');
const { expect } = require('chai');

describe('receipts plugin', () => {
describe('register schema', () => {
Expand Down Expand Up @@ -124,7 +123,6 @@ describe('receipts plugin', () => {
});
});


describe('conditional schema', () => {
describe('uses the correct conditional schema depending on receipt type', () => {
const formatReceipt = receipt => {
Expand Down
2 changes: 1 addition & 1 deletion catapult-sdk/test/testUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*/

const convert = require('../src/utils/convert');
const crypto = require('crypto');
const sizes = require('../src/modelBinary/sizes');
const { createKeyPairFromPrivateKeyString } = require('../src/crypto/keyPair');
const crypto = require('crypto');

module.exports = {
constants: { sizes },
Expand Down
4 changes: 2 additions & 2 deletions catapult-sdk/test/utils/base32_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ describe('base32', () => {
const encoded = base32.encode(data);

// Assert:
const expected =
'AAAQEAYEAUDAOCAJBIFQYDIOB4IBCEQTCQKRMFYY'
const expected = ''
+ 'AAAQEAYEAUDAOCAJBIFQYDIOB4IBCEQTCQKRMFYY'
+ 'DENBWHA5DYPSAIJCEMSCKJRHFAUSUKZMFUXC6MBR'
+ 'GIZTINJWG44DSOR3HQ6T4P2AIFBEGRCFIZDUQSKK'
+ 'JNGE2TSPKBIVEU2UKVLFOWCZLJNVYXK6L5QGCYTD'
Expand Down
Loading

0 comments on commit b1407d7

Please sign in to comment.