@@ -12,23 +12,23 @@ import type {
1212} from './types' ;
1313import type {
1414 Claim ,
15- ClaimId , ClaimIdEncoded ,
15+ ClaimId ,
16+ ClaimIdEncoded ,
1617 SignedClaim ,
17- } from " ../claims/types" ;
18+ } from ' ../claims/types' ;
1819import type TaskManager from '../tasks/TaskManager' ;
1920import type GestaltGraph from '../gestalts/GestaltGraph' ;
2021import type { TaskHandler , TaskHandlerId , Task } from '../tasks/types' ;
2122import type { ContextTimed } from '@matrixai/contexts' ;
2223import type { PromiseCancellable } from '@matrixai/async-cancellable' ;
2324import type { Host , Port } from '../network/types' ;
24- import type {
25- SignedTokenEncoded ,
26- TokenHeaderSignatureEncoded ,
27- TokenPayloadEncoded
28- } from "../tokens/types" ;
25+ import type { SignedTokenEncoded } from '../tokens/types' ;
2926import type { ClaimLinkNode } from '../claims/payloads/index' ;
30- import type { ServerDuplexStream } from '@grpc/grpc-js' ;
31- import type { AsyncGeneratorDuplexStream } from '../grpc/types' ;
27+ import type { AgentClaimMessage } from '../agent/handlers/types' ;
28+ import type {
29+ AgentRPCRequestParams ,
30+ AgentRPCResponseResult ,
31+ } from '../agent/types' ;
3232import Logger from '@matrixai/logger' ;
3333import { StartStop , ready } from '@matrixai/async-init/dist/StartStop' ;
3434import { Semaphore , Lock } from '@matrixai/async-locks' ;
@@ -37,19 +37,17 @@ import { Timer } from '@matrixai/timer';
3737import { timedCancellable , context } from '@matrixai/contexts/dist/decorators' ;
3838import * as nodesErrors from './errors' ;
3939import * as nodesUtils from './utils' ;
40+ import * as claimsUtils from '../claims/utils' ;
4041import * as tasksErrors from '../tasks/errors' ;
4142import * as claimsErrors from '../claims/errors' ;
4243import * as keysUtils from '../keys/utils' ;
43- import { never , promise } from " ../utils/utils" ;
44+ import { never , promise } from ' ../utils/utils' ;
4445import {
4546 decodeClaimId ,
4647 encodeClaimId ,
4748 parseSignedClaim ,
4849} from '../claims/utils' ;
4950import Token from '../tokens/Token' ;
50- import { AgentRPCRequestParams , AgentRPCResponseResult } from "@/agent/types" ;
51- import { AgentClaimMessage } from "../agent/handlers/types" ;
52- import * as claimsUtils from "@/claims/utils" ;
5351
5452const abortEphemeralTaskReason = Symbol ( 'abort ephemeral task reason' ) ;
5553const abortSingletonTaskReason = Symbol ( 'abort singleton task reason' ) ;
@@ -366,7 +364,8 @@ class NodeManager {
366364 const claims : Record < ClaimId , SignedClaim > = { } ;
367365 const client = connection . getClient ( ) ;
368366 for await ( const agentClaim of await client . methods . nodesChainDataGet ( {
369- claimIdEncoded : claimId != null ? encodeClaimId ( claimId ) : "" as ClaimIdEncoded ,
367+ claimIdEncoded :
368+ claimId != null ? encodeClaimId ( claimId ) : ( '' as ClaimIdEncoded ) ,
370369 } ) ) {
371370 if ( ctx . signal . aborted ) throw ctx . signal . reason ;
372371 // Need to re-construct each claim
@@ -448,7 +447,9 @@ class NodeManager {
448447 }
449448 const receivedClaim = readStatus . value ;
450449 // We need to re-construct the token from the message
451- const signedClaim = parseSignedClaim ( receivedClaim . signedTokenEncoded ) ;
450+ const signedClaim = parseSignedClaim (
451+ receivedClaim . signedTokenEncoded ,
452+ ) ;
452453 fullySignedToken = Token . fromSigned ( signedClaim ) ;
453454 // Check that the signatures are correct
454455 const targetNodePublicKey =
@@ -469,7 +470,9 @@ class NodeManager {
469470 }
470471 const receivedClaimRemote = readStatus2 . value ;
471472 // We need to re-construct the token from the message
472- const signedClaimRemote = parseSignedClaim ( receivedClaimRemote . signedTokenEncoded ) ;
473+ const signedClaimRemote = parseSignedClaim (
474+ receivedClaimRemote . signedTokenEncoded ,
475+ ) ;
473476 // This is a singly signed claim,
474477 // we want to verify it before signing and sending back
475478 const signedTokenRemote = Token . fromSigned ( signedClaimRemote ) ;
@@ -478,8 +481,9 @@ class NodeManager {
478481 }
479482 signedTokenRemote . signWithPrivateKey ( this . keyRing . keyPair ) ;
480483 // 4. X <- responds with double signing the X signed claim <- Y
481- const agentClaimedMessageRemote =
482- claimsUtils . generateSignedClaim ( signedTokenRemote . toSigned ( ) ) ;
484+ const agentClaimedMessageRemote = claimsUtils . generateSignedClaim (
485+ signedTokenRemote . toSigned ( ) ,
486+ ) ;
483487 await writer . write ( {
484488 signedTokenEncoded : agentClaimedMessageRemote ,
485489 } ) ;
@@ -589,7 +593,7 @@ class NodeManager {
589593 ) ;
590594 yield {
591595 signedTokenEncoded : await halfSignedClaimProm . p ,
592- }
596+ } ;
593597 const [ , claim ] = await claimProm ;
594598 // With the claim created we want to add it to the gestalt graph
595599 const issNodeInfo = {
0 commit comments