Skip to content

Commit 452ce01

Browse files
committed
fix: lint and tests
1 parent 1760ab5 commit 452ce01

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/nodes/NodeManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ class NodeManager<Manifest extends AgentClientManifestNodeManager> {
301301
if (ctx.signal.aborted) return;
302302

303303
if (network != null) {
304-
if (this.getClaimNetworkAccess(network) == null) {
304+
if ((await this.getClaimNetworkAccess(network)) == null) {
305305
await this.claimNetwork(successfulConnections[0].value.nodeId, network);
306306
} else {
307307
await this.switchNetwork(network);

tests/nodes/NodeManager.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,7 @@ describe(`${NodeManager.name}`, () => {
30173017
);
30183018

30193019
// We have now proved that a node can request access to the network from a node with network authority.
3020-
// Now We should be able to connect while authenticated to the seed node.
3020+
// Now we should be able to connect while authenticated to the seed node.
30213021

30223022
// Re-initiate authentication
30233023
await seedNode.nodeConnectionManager.destroyConnection(node1Id, true);
@@ -3030,9 +3030,7 @@ describe(`${NodeManager.name}`, () => {
30303030

30313031
const networkAccess =
30323032
await node1.nodeManager.getClaimNetworkAccess(network);
3033-
if (networkAccess == null) {
3034-
throw new Error('network access claim not found');
3035-
}
3033+
if (networkAccess == null) fail('network access claim not found');
30363034
claimNetworkAccessUtils.verifyClaimNetworkAccess(
30373035
networkNodeId,
30383036
node1Id,
@@ -3096,15 +3094,17 @@ describe(`${NodeManager.name}`, () => {
30963094

30973095
// Check the claim once we have re-authenticated
30983096
const token1 = await node1.nodeManager.getClaimNetworkAccess(network);
3099-
if (token1 == null) throw new Error('network access claim not found');
3097+
if (token1 == null) fail('network access claim not found');
31003098
const token1Id = token1.payload.jti;
31013099

31023100
// Try claiming again
3103-
await expect(node1.nodeManager.claimNetwork(seedNodeId, network)).toReject();
3101+
await expect(
3102+
node1.nodeManager.claimNetwork(seedNodeId, network),
3103+
).toReject();
31043104

31053105
// The token should not have changed
31063106
const token2 = await node1.nodeManager.getClaimNetworkAccess(network);
3107-
if (token2 == null) throw new Error('network access claim not found');
3107+
if (token2 == null) fail('network access claim not found');
31083108
const token2Id = token2.payload.jti;
31093109
expect(token1Id).toBe(token2Id);
31103110
});

0 commit comments

Comments
 (0)