Skip to content

Commit e6d579d

Browse files
authored
chore: update dependencies and apply formatting (#3624)
1 parent a82a094 commit e6d579d

File tree

313 files changed

+4029
-4431
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+4029
-4431
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"@typescript-eslint/no-misused-promises": "off",
2929
"@typescript-eslint/no-namespace": "off",
3030
"@typescript-eslint/no-non-null-assertion": "off",
31-
"@typescript-eslint/no-unnecessary-condition": "off",
31+
"@typescript-eslint/no-unsafe-call": "off",
32+
"@typescript-eslint/no-unsafe-member-access": "off",
3233
"@typescript-eslint/no-unused-vars": "off",
3334
"@typescript-eslint/no-var-requires": "off",
3435
"@typescript-eslint/prefer-regexp-exec": "off",
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
const express = require('express');
1+
const express = require("express");
22
const app = express();
33

44
const ips = {};
55
const sources = [];
6-
app.get('/', function (req, res) {
6+
app.get("/", function (req, res) {
77
console.log(`received peer discovery request from ${req.ip} !`);
88
if (!ips[req.ip]) {
99
ips[req.ip] = true;
1010
sources.push({ ip: req.ip, port: 4000 });
1111
}
1212
console.log(`responding with ${JSON.stringify(sources)}`);
1313
res.send(sources);
14-
})
14+
});
1515

1616
app.listen(3000, function () {
17-
console.log('Peer discovery app listening on port 3000!')
18-
})
17+
console.log("Peer discovery app listening on port 3000!");
18+
});

__tests__/functional/transaction-forging/__support__/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ export const setUp = async (): Promise<Contracts.Kernel.Application> => {
1818
flags: {
1919
token: "ark",
2020
network: "testnet",
21-
env: "test"
21+
env: "test",
2222
},
2323
peers: {
24-
list: [ { ip: "127.0.0.1", port: 4000 }]
24+
list: [{ ip: "127.0.0.1", port: 4000 }],
2525
},
2626
});
2727
await sandbox.boot(async ({ app }) => {

__tests__/integration/core-api/__support__/setup.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export const setUp = async () => {
1616
flags: {
1717
token: "ark",
1818
network: "unitnet",
19-
env: "test"
19+
env: "test",
2020
},
2121
peers: {
22-
list: [ { ip: "127.0.0.1", port: 4000 }] // need some peers defined for the app to run
22+
list: [{ ip: "127.0.0.1", port: 4000 }], // need some peers defined for the app to run
2323
},
2424
});
2525
await sandbox
@@ -129,7 +129,7 @@ export const calculateRanks = async () => {
129129
.comparedTo(a.getAttribute<Utils.BigNumber>("delegate.voteBalance")),
130130
);
131131

132-
AppUtils.sortBy(delegateWallets, wallet => wallet.publicKey).forEach((delegate, i) => {
132+
AppUtils.sortBy(delegateWallets, (wallet) => wallet.publicKey).forEach((delegate, i) => {
133133
const wallet = walletRepository.findByPublicKey(delegate.publicKey!);
134134
wallet.setAttribute("delegate.rank", i + 1);
135135

__tests__/integration/core-api/handlers/locks.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,31 +81,31 @@ describe("API 2.0 - Locks", () => {
8181
expect(response).toBeSuccessfulResponse();
8282
expect(response.data.data).toBeArray();
8383
expect(response.data.data).not.toBeEmpty();
84-
expect(response.data.data.every(lock => lock.expirationType === 1)).toBeTrue();
84+
expect(response.data.data.every((lock) => lock.expirationType === 1)).toBeTrue();
8585
});
8686

8787
it("should GET all the locks by height expiration", async () => {
8888
const response = await api.request("GET", "locks", { expirationType: 2 });
8989
expect(response).toBeSuccessfulResponse();
9090
expect(response.data.data).toBeArray();
9191
expect(response.data.data).not.toBeEmpty();
92-
expect(response.data.data.every(lock => lock.expirationType === 2)).toBeTrue();
92+
expect(response.data.data.every((lock) => lock.expirationType === 2)).toBeTrue();
9393
});
9494

9595
it("should GET all the locks that are expired", async () => {
9696
const response = await api.request("GET", "locks", { isExpired: true });
9797
expect(response).toBeSuccessfulResponse();
9898
expect(response.data.data).toBeArray();
9999
expect(response.data.data).not.toBeEmpty();
100-
expect(response.data.data.every(lock => lock.isExpired)).toBeTrue();
100+
expect(response.data.data.every((lock) => lock.isExpired)).toBeTrue();
101101
});
102102

103103
it("should GET all the locks that are not expired", async () => {
104104
const response = await api.request("GET", "locks", { isExpired: false });
105105
expect(response).toBeSuccessfulResponse();
106106
expect(response.data.data).toBeArray();
107107
expect(response.data.data).not.toBeEmpty();
108-
expect(response.data.data.every(lock => !lock.isExpired)).toBeTrue();
108+
expect(response.data.data.every((lock) => !lock.isExpired)).toBeTrue();
109109
});
110110

111111
describe("orderBy", () => {

__tests__/integration/core-api/handlers/peers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ beforeAll(async () => {
3434
app = await setUp();
3535
api = new ApiHelpers(app);
3636

37-
const peerMocks = peers.map(mock => {
37+
const peerMocks = peers.map((mock) => {
3838
const peerMock = new Peer(mock.ip, mock.port);
3939
peerMock.version = mock.version;
4040
peerMock.latency = mock.latency;

__tests__/integration/core-api/handlers/transactions.test.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { generateMnemonic } from "bip39";
1010

1111
import { setUp, tearDown } from "../__support__/setup";
1212

13-
export const generateWallets = quantity => {
13+
export const generateWallets = (quantity) => {
1414
const wallets: { address: string; passphrase: string; publicKey: string }[] = [];
1515

1616
for (let i = 0; i < quantity; i++) {
@@ -56,13 +56,13 @@ beforeAll(async () => {
5656
app = await setUp();
5757
api = new ApiHelpers(app);
5858

59-
delegates = secrets.map(secret => {
59+
delegates = secrets.map((secret) => {
6060
const publicKey: string = Identities.PublicKey.fromPassphrase(secret);
6161
const address: string = Identities.Address.fromPassphrase(secret);
6262

6363
const transaction: { amount: string } = Managers.configManager
6464
.get("genesisBlock")
65-
.transactions.find(transaction => transaction.recipientId === address && transaction.type === 0);
65+
.transactions.find((transaction) => transaction.recipientId === address && transaction.type === 0);
6666

6767
return {
6868
secret,
@@ -705,7 +705,7 @@ describe("API 2.0 - Transactions", () => {
705705
expect(response.data.data.invalid[0]).toBe(transactions[1].id);
706706
});
707707

708-
it.each([3, 5, 8])("should accept and broadcast %i transactions emptying a wallet", async txNumber => {
708+
it.each([3, 5, 8])("should accept and broadcast %i transactions emptying a wallet", async (txNumber) => {
709709
const sender = delegates[txNumber]; // use txNumber so that we use a different delegate for each test case
710710
const receivers = generateWallets(2);
711711
const amountPlusFee = Math.floor(+sender.balance / txNumber);
@@ -730,16 +730,18 @@ describe("API 2.0 - Transactions", () => {
730730

731731
expect(response).toBeSuccessfulResponse();
732732

733-
expect(response.data.data.accept.sort()).toEqual(allTransactions.map(transaction => transaction.id).sort());
733+
expect(response.data.data.accept.sort()).toEqual(
734+
allTransactions.map((transaction) => transaction.id).sort(),
735+
);
734736
expect(response.data.data.broadcast.sort()).toEqual(
735-
allTransactions.map(transaction => transaction.id).sort(),
737+
allTransactions.map((transaction) => transaction.id).sort(),
736738
);
737739
expect(response.data.data.invalid).toHaveLength(0);
738740
});
739741

740742
it.each([3, 5, 8])(
741743
"should not accept the last of %i transactions emptying a wallet when the last one is 1 satoshi too much",
742-
async txNumber => {
744+
async (txNumber) => {
743745
const sender = delegates[txNumber + 1]; // use txNumber + 1 so that we don't use the same delegates as the above test
744746
const receivers = generateWallets(2);
745747
const amountPlusFee = Math.floor(+sender.balance / txNumber);
@@ -769,12 +771,12 @@ describe("API 2.0 - Transactions", () => {
769771
expect(response).toBeSuccessfulResponse();
770772

771773
expect(response.data.data.accept.sort()).toEqual(
772-
transactions.map(transaction => transaction.id).sort(),
774+
transactions.map((transaction) => transaction.id).sort(),
773775
);
774776
expect(response.data.data.broadcast.sort()).toEqual(
775-
transactions.map(transaction => transaction.id).sort(),
777+
transactions.map((transaction) => transaction.id).sort(),
776778
);
777-
expect(response.data.data.invalid).toEqual(lastTransaction.map(transaction => transaction.id));
779+
expect(response.data.data.invalid).toEqual(lastTransaction.map((transaction) => transaction.id));
778780
},
779781
);
780782
});

__tests__/integration/core-api/handlers/wallets.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ describe("API 2.0 - Wallets", () => {
278278
api.expectWallet(wallet);
279279
}
280280

281-
const addresses = response.data.data.map(wallet => wallet.address).sort();
281+
const addresses = response.data.data.map((wallet) => wallet.address).sort();
282282
expect(addresses).toEqual([address, address2]);
283283
});
284284

__tests__/unit/core-api/__support__/index.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,17 @@ export const initApp = (): Application => {
6262

6363
app.bind(Container.Identifiers.BlockRepository).toConstantValue(Mocks.BlockRepository.instance);
6464

65-
app.bind(Container.Identifiers.TransactionRepository).toConstantValue(
66-
Mocks.TransactionRepository.instance,
67-
);
65+
app.bind(Container.Identifiers.TransactionRepository).toConstantValue(Mocks.TransactionRepository.instance);
6866

6967
app.bind(Container.Identifiers.PeerNetworkMonitor).toConstantValue(Mocks.NetworkMonitor.instance);
7068

7169
app.bind(Container.Identifiers.PeerStorage).toConstantValue(Mocks.PeerStorage.instance);
7270

7371
app.bind(Container.Identifiers.RoundRepository).toConstantValue(Mocks.RoundRepository.instance);
7472

75-
app.bind(Container.Identifiers.TransactionPoolQuery).toConstantValue(
76-
Mocks.TransactionPoolQuery.instance,
77-
);
73+
app.bind(Container.Identifiers.TransactionPoolQuery).toConstantValue(Mocks.TransactionPoolQuery.instance);
7874

79-
app.bind(Container.Identifiers.TransactionPoolProcessor).toConstantValue(
80-
Mocks.TransactionPoolProcessor.instance,
81-
);
75+
app.bind(Container.Identifiers.TransactionPoolProcessor).toConstantValue(Mocks.TransactionPoolProcessor.instance);
8276

8377
app.bind(Container.Identifiers.TransactionPoolProcessorFactory).toFactory(() => () => {
8478
return Mocks.TransactionPoolProcessor.instance;

__tests__/unit/core-api/resources/ports.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ beforeEach(() => {
1616
app = initApp();
1717

1818
app.unbind(Identifiers.ServiceProviderRepository);
19-
app.bind(Identifiers.ServiceProviderRepository).toConstantValue(
20-
Mocks.ServiceProviderRepository.instance,
21-
);
19+
app.bind(Identifiers.ServiceProviderRepository).toConstantValue(Mocks.ServiceProviderRepository.instance);
2220
});
2321

2422
beforeEach(() => {

0 commit comments

Comments
 (0)