Skip to content

Commit 591c7ef

Browse files
committed
removed async await eslint errors
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent 6d8b3e9 commit 591c7ef

29 files changed

+256
-207
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/**
2+
* Copyright (C) 2024 Hedera Hashgraph, LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the ""License"");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an ""AS IS"" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
import globals from 'globals'
18+
import path from 'node:path'
19+
import { fileURLToPath } from 'node:url'
20+
import js from '@eslint/js'
21+
import { FlatCompat } from '@eslint/eslintrc'
22+
23+
const __filename = fileURLToPath(import.meta.url)
24+
const __dirname = path.dirname(__filename)
25+
const compat = new FlatCompat({
26+
baseDirectory: __dirname,
27+
recommendedConfig: js.configs.recommended,
28+
allConfig: js.configs.all
29+
})
30+
31+
export default [...compat.extends('standard'), {
32+
languageOptions: {
33+
globals: {
34+
...globals.browser
35+
},
36+
37+
ecmaVersion: 'latest',
38+
sourceType: 'module'
39+
},
40+
41+
rules: {
42+
'no-template-curly-in-string': 'off'
43+
}
44+
}, {
45+
files: ['**/*.mjs'],
46+
47+
languageOptions: {
48+
ecmaVersion: 'latest',
49+
sourceType: 'module'
50+
}
51+
}]

package-lock.json

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"eslint": "^9.11.1",
7777
"eslint-plugin-headers": "^1.1.2",
7878
"eslint-plugin-promise": "^7.1.0",
79-
"globals": "^15.10.0",
8079
"jest": "^29.7.0",
8180
"jest-environment-steps": "^1.1.1",
8281
"jest-expect-message": "^1.1.3",

src/commands/account.mjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export class AccountCommand extends BaseCommand {
9191
* @param {any} ctx
9292
* @returns {Promise<AccountInfo>}
9393
*/
94-
async getAccountInfo (ctx) {
94+
getAccountInfo (ctx) {
9595
return this.accountManager.accountInfoQuery(ctx.config.accountId)
9696
}
9797

@@ -168,7 +168,7 @@ export class AccountCommand extends BaseCommand {
168168
},
169169
{
170170
title: 'Update special account keys',
171-
task: async (ctx, task) => {
171+
task: (ctx, task) => {
172172
return new Listr([
173173
{
174174
title: 'Prepare for account key updates',
@@ -190,7 +190,7 @@ export class AccountCommand extends BaseCommand {
190190
},
191191
{
192192
title: 'Update special account key sets',
193-
task: async (ctx) => {
193+
task: (ctx) => {
194194
const subTasks = []
195195
const realm = constants.HEDERA_NODE_ACCOUNT_ID_START.realm
196196
const shard = constants.HEDERA_NODE_ACCOUNT_ID_START.shard
@@ -219,7 +219,7 @@ export class AccountCommand extends BaseCommand {
219219
},
220220
{
221221
title: 'Display results',
222-
task: async (ctx) => {
222+
task: (ctx) => {
223223
self.logger.showUser(chalk.green(`Account keys updated SUCCESSFULLY: ${ctx.resultTracker.fulfilledCount}`))
224224
if (ctx.resultTracker.skippedCount > 0) self.logger.showUser(chalk.cyan(`Account keys updates SKIPPED: ${ctx.resultTracker.skippedCount}`))
225225
if (ctx.resultTracker.rejectedCount > 0) {

src/commands/cluster.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class ClusterCommand extends BaseCommand {
4141
* Get cluster-info for the given cluster name
4242
* @returns {Promise<boolean>}
4343
*/
44-
async getClusterInfo () {
44+
getClusterInfo () {
4545
try {
4646
const cluster = this.k8.getKubeConfig().getCurrentCluster()
4747
this.logger.showJSON(`Cluster Information (${cluster.name})`, cluster)

src/commands/init.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ export class InitCommand extends BaseCommand {
7272
const tasks = new Listr([
7373
{
7474
title: 'Setup home directory and cache',
75-
task: async (ctx, _) => {
75+
task: (ctx, _) => {
7676
self.configManager.update(argv)
7777
ctx.dirs = this.setupHomeDirectory()
7878
}
7979
},
8080
{
8181
title: 'Check dependencies',
82-
task: async (_, task) => {
82+
task: (_, task) => {
8383
const deps = [
8484
core.constants.HELM
8585
]

src/commands/mirror_node.mjs

+3-3
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class MirrorNodeCommand extends BaseCommand {
204204
},
205205
{
206206
title: 'Enable mirror-node',
207-
task: async (ctx, parentTask) => {
207+
task: (ctx, parentTask) => {
208208
const subTasks = [
209209
{
210210
title: 'Prepare address book',
@@ -235,7 +235,7 @@ export class MirrorNodeCommand extends BaseCommand {
235235
},
236236
{
237237
title: 'Check pods are ready',
238-
task: async (ctx, parentTask) => {
238+
task: (ctx, parentTask) => {
239239
const subTasks = [
240240
{
241241
title: 'Check Postgres DB',
@@ -290,7 +290,7 @@ export class MirrorNodeCommand extends BaseCommand {
290290
},
291291
{
292292
title: 'Seed DB data',
293-
task: async (ctx, parentTask) => {
293+
task: (ctx, parentTask) => {
294294
const subTasks = [
295295
{
296296
title: 'Insert data in public.file_data',

src/commands/network.mjs

+79-79
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export class NetworkCommand extends BaseCommand {
252252
},
253253
{
254254
title: 'Prepare staging directory',
255-
task: async (ctx, parentTask) => {
255+
task: (ctx, parentTask) => {
256256
const subTasks = [
257257
{
258258
title: 'Copy Gossip keys to staging',
@@ -282,7 +282,7 @@ export class NetworkCommand extends BaseCommand {
282282
},
283283
{
284284
title: 'Copy node keys to secrets',
285-
task: async (ctx, parentTask) => {
285+
task: (ctx, parentTask) => {
286286
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
287287

288288
const subTasks = self.platformInstaller.copyNodeKeys(config.stagingDir, config.nodeAliases)
@@ -313,92 +313,92 @@ export class NetworkCommand extends BaseCommand {
313313
{
314314
title: 'Check node pods are running',
315315
task:
316-
async (ctx, task) => {
317-
const subTasks = []
318-
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
319-
320-
// nodes
321-
for (const nodeAlias of config.nodeAliases) {
322-
subTasks.push({
323-
title: `Check Node: ${chalk.yellow(nodeAlias)}`,
324-
task: async () =>
325-
await self.k8.waitForPods([constants.POD_PHASE_RUNNING], [
326-
'fullstack.hedera.com/type=network-node',
316+
(ctx, task) => {
317+
const subTasks = []
318+
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
319+
320+
// nodes
321+
for (const nodeAlias of config.nodeAliases) {
322+
subTasks.push({
323+
title: `Check Node: ${chalk.yellow(nodeAlias)}`,
324+
task: async () =>
325+
await self.k8.waitForPods([constants.POD_PHASE_RUNNING], [
326+
'fullstack.hedera.com/type=network-node',
327327
`fullstack.hedera.com/node-name=${nodeAlias}`
328-
], 1, 60 * 15, 1000) // timeout 15 minutes
329-
})
330-
}
331-
332-
// set up the sub-tasks
333-
return task.newListr(subTasks, {
334-
concurrent: false, // no need to run concurrently since if one node is up, the rest should be up by then
335-
rendererOptions: {
336-
collapseSubtasks: false
337-
}
338-
})
339-
}
328+
], 1, 60 * 15, 1000) // timeout 15 minutes
329+
})
330+
}
331+
332+
// set up the sub-tasks
333+
return task.newListr(subTasks, {
334+
concurrent: false, // no need to run concurrently since if one node is up, the rest should be up by then
335+
rendererOptions: {
336+
collapseSubtasks: false
337+
}
338+
})
339+
}
340340
},
341341
{
342342
title: 'Check proxy pods are running',
343343
task:
344-
async (ctx, task) => {
345-
const subTasks = []
346-
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
347-
348-
// HAProxy
349-
for (const nodeAlias of config.nodeAliases) {
350-
subTasks.push({
351-
title: `Check HAProxy for: ${chalk.yellow(nodeAlias)}`,
352-
task: async () =>
353-
await self.k8.waitForPods([constants.POD_PHASE_RUNNING], [
354-
'fullstack.hedera.com/type=haproxy'
355-
], 1, 60 * 15, 1000) // timeout 15 minutes
356-
})
357-
}
358-
359-
// Envoy Proxy
360-
for (const nodeAlias of config.nodeAliases) {
361-
subTasks.push({
362-
title: `Check Envoy Proxy for: ${chalk.yellow(nodeAlias)}`,
363-
task: async () =>
364-
await self.k8.waitForPods([constants.POD_PHASE_RUNNING], [
365-
'fullstack.hedera.com/type=envoy-proxy'
366-
], 1, 60 * 15, 1000) // timeout 15 minutes
367-
})
368-
}
369-
370-
// set up the sub-tasks
371-
return task.newListr(subTasks, {
372-
concurrent: true,
373-
rendererOptions: {
374-
collapseSubtasks: false
375-
}
376-
})
377-
}
344+
(ctx, task) => {
345+
const subTasks = []
346+
const config = /** @type {NetworkDeployConfigClass} **/ ctx.config
347+
348+
// HAProxy
349+
for (const nodeAlias of config.nodeAliases) {
350+
subTasks.push({
351+
title: `Check HAProxy for: ${chalk.yellow(nodeAlias)}`,
352+
task: async () =>
353+
await self.k8.waitForPods([constants.POD_PHASE_RUNNING], [
354+
'fullstack.hedera.com/type=haproxy'
355+
], 1, 60 * 15, 1000) // timeout 15 minutes
356+
})
357+
}
358+
359+
// Envoy Proxy
360+
for (const nodeAlias of config.nodeAliases) {
361+
subTasks.push({
362+
title: `Check Envoy Proxy for: ${chalk.yellow(nodeAlias)}`,
363+
task: async () =>
364+
await self.k8.waitForPods([constants.POD_PHASE_RUNNING], [
365+
'fullstack.hedera.com/type=envoy-proxy'
366+
], 1, 60 * 15, 1000) // timeout 15 minutes
367+
})
368+
}
369+
370+
// set up the sub-tasks
371+
return task.newListr(subTasks, {
372+
concurrent: true,
373+
rendererOptions: {
374+
collapseSubtasks: false
375+
}
376+
})
377+
}
378378
},
379379
{
380380
title: 'Check auxiliary pods are ready',
381381
task:
382-
async (ctx, task) => {
383-
const subTasks = []
384-
385-
// minio
386-
subTasks.push({
387-
title: 'Check MinIO',
388-
task: async () =>
389-
await self.k8.waitForPodReady([
390-
'v1.min.io/tenant=minio'
391-
], 1, 60 * 5, 1000) // timeout 5 minutes
392-
})
393-
394-
// set up the sub-tasks
395-
return task.newListr(subTasks, {
396-
concurrent: false, // no need to run concurrently since if one node is up, the rest should be up by then
397-
rendererOptions: {
398-
collapseSubtasks: false
399-
}
400-
})
401-
}
382+
(ctx, task) => {
383+
const subTasks = []
384+
385+
// minio
386+
subTasks.push({
387+
title: 'Check MinIO',
388+
task: async () =>
389+
await self.k8.waitForPodReady([
390+
'v1.min.io/tenant=minio'
391+
], 1, 60 * 5, 1000) // timeout 5 minutes
392+
})
393+
394+
// set up the sub-tasks
395+
return task.newListr(subTasks, {
396+
concurrent: false, // no need to run concurrently since if one node is up, the rest should be up by then
397+
rendererOptions: {
398+
collapseSubtasks: false
399+
}
400+
})
401+
}
402402
}
403403
], {
404404
concurrent: false,

0 commit comments

Comments
 (0)