Skip to content

Commit

Permalink
refactor: thor client's node module (#309)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierobassa authored Nov 28, 2023
1 parent 01a9709 commit 5da68b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/network/src/clients/thor-client/nodes/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './nodes-client';
export * from './nodes-module';
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import { assert, DATA } from '@vechainfoundation/vechain-sdk-errors';
import { type BlockDetail, BlocksClient } from '../../thorest-client';

/**
* Provides utility method for checking the health of a node.
* The `NodesModule` class serves as a module for node-related functionality, for example, checking the health of a node.
*/
class NodesClient {
class NodesModule {
/**
* Internal blocks client instance used for interacting with block-related endpoints.
*/
Expand Down Expand Up @@ -92,4 +92,4 @@ class NodesClient {
};
}

export { NodesClient };
export { NodesModule };
6 changes: 3 additions & 3 deletions packages/network/src/clients/thor-client/thor-client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type HttpClient } from '../../utils';
import { NodesClient } from './nodes';
import { NodesModule } from './nodes';

/**
* The `ThorClient` class serves as an interface to interact with the Vechain Thor blockchain.
Expand All @@ -10,14 +10,14 @@ class ThorClient {
/**
* The `NodeClient` instance
*/
public readonly nodes: NodesClient;
public readonly nodes: NodesModule;

/**
* Constructs a new `ThorClient` instance with a given HTTP client.
* @param httpClient - The HTTP client instance used for making network requests.
*/
constructor(protected readonly httpClient: HttpClient) {
this.nodes = new NodesClient(httpClient);
this.nodes = new NodesModule(httpClient);
}
}

Expand Down

1 comment on commit 5da68b3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test Coverage

Summary

Lines Statements Branches Functions
Coverage: 100%
100% (1160/1160) 100% (277/277) 100% (239/239)
Title Tests Skipped Failures Errors Time
core 319 0 💤 0 ❌ 0 🔥 1m 30s ⏱️
network 79 0 💤 0 ❌ 0 🔥 52.784s ⏱️
errors 30 0 💤 0 ❌ 0 🔥 12.081s ⏱️

Please sign in to comment.