From 0fd2f38aec8c4f8b4c07da52ab5f8b938185a0f4 Mon Sep 17 00:00:00 2001 From: Amy Yan Date: Mon, 2 Sep 2024 16:16:11 +1000 Subject: [PATCH] wip --- src/nodes/NodeManager.ts | 2 +- .../agent/handlers/nodesClaimNetworkVerify.test.ts | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/nodes/NodeManager.ts b/src/nodes/NodeManager.ts index 8cd47d92b..4f0b3747f 100644 --- a/src/nodes/NodeManager.ts +++ b/src/nodes/NodeManager.ts @@ -51,6 +51,7 @@ import * as nodesErrors from './errors'; import * as agentErrors from './agent/errors'; import NodeConnectionQueue from './NodeConnectionQueue'; import { assertClaimNetworkAuthority } from '../claims/payloads/claimNetworkAuthority'; +import { assertClaimNetworkAccess } from '../claims/payloads/claimNetworkAccess'; import Token from '../tokens/Token'; import * as keysUtils from '../keys/utils'; import * as tasksErrors from '../tasks/errors'; @@ -59,7 +60,6 @@ import * as claimsErrors from '../claims/errors'; import * as utils from '../utils/utils'; import config from '../config'; import * as networkUtils from '../network/utils'; -import { assertClaimNetworkAccess } from '../claims/payloads/claimNetworkAccess'; const abortEphemeralTaskReason = Symbol('abort ephemeral task reason'); const abortSingletonTaskReason = Symbol('abort singleton task reason'); diff --git a/tests/nodes/agent/handlers/nodesClaimNetworkVerify.test.ts b/tests/nodes/agent/handlers/nodesClaimNetworkVerify.test.ts index dbdfe22ea..4859ed36f 100644 --- a/tests/nodes/agent/handlers/nodesClaimNetworkVerify.test.ts +++ b/tests/nodes/agent/handlers/nodesClaimNetworkVerify.test.ts @@ -11,10 +11,11 @@ import Logger, { LogLevel, StreamHandler } from '@matrixai/logger'; import { QUICClient, QUICServer, events as quicEvents } from '@matrixai/quic'; import { DB } from '@matrixai/db'; import { RPCClient, RPCServer } from '@matrixai/rpc'; +import { nodesClaimNetworkVerify } from '@/nodes/agent/callers'; +import { Token } from '@/tokens'; import Sigchain from '@/sigchain/Sigchain'; import KeyRing from '@/keys/KeyRing'; import NodeGraph from '@/nodes/NodeGraph'; -import { nodesClaimNetworkVerify } from '@/nodes/agent/callers'; import NodesClaimNetworkVerify from '@/nodes/agent/handlers/NodesClaimNetworkVerify'; import ACL from '@/acl/ACL'; import NodeManager from '@/nodes/NodeManager'; @@ -22,9 +23,7 @@ import GestaltGraph from '@/gestalts/GestaltGraph'; import TaskManager from '@/tasks/TaskManager'; import * as keysUtils from '@/keys/utils'; import * as claimsUtils from '@/claims/utils'; -import { Token } from '@/tokens'; import * as nodesUtils from '@/nodes/utils'; -import { generateKeyPair } from '@/keys/utils/generate'; import * as networkUtils from '@/network/utils'; import * as tlsTestsUtils from '../../../utils/tls'; @@ -201,7 +200,7 @@ describe('nodesClaimNetworkVerify', () => { logger, }); - clientKeyPair = generateKeyPair(); + clientKeyPair = keysUtils.generateKeyPair(); localNodeId = keysUtils.publicKeyToNodeId(clientKeyPair.publicKey); const tlsConfigClient = await tlsTestsUtils.createTLSConfig(clientKeyPair); @@ -221,9 +220,9 @@ describe('nodesClaimNetworkVerify', () => { logger, }); - authorityKeyPair = generateKeyPair(); + authorityKeyPair = keysUtils.generateKeyPair(); authorityNodeId = keysUtils.publicKeyToNodeId(authorityKeyPair.publicKey); - seedKeyPair = generateKeyPair(); + seedKeyPair = keysUtils.generateKeyPair(); seedNodeId = keysUtils.publicKeyToNodeId(seedKeyPair.publicKey); const authorityClaimId = claimsUtils.createClaimIdGenerator(authorityNodeId)();