Skip to content

Fix node claims throughout tests/ #306

@joshuakarp

Description

@joshuakarp

Specification

There are several occurrences of node claims that are being incorrectly set up throughout the testing suites.

Consider the situation where we have two nodes, B and C, with a cryptolink between them (i.e. part of the same gestalt). The cryptolink should be represented by a single claim on each node's sigchain (that's been signed by both B and C). That is, B will have a single claim signed by both itself and C, and C will have a single claim signed by both itself and B.

However, there are some tests that aren't setting this up correctly. For example, in tests/bin/identities.test.ts:

      // Adding sigchain details.
      const claimBtoC: ClaimLinkNode = {
        type: 'node',
        node1: nodeB.nodeManager.getNodeId(),
        node2: nodeC.nodeManager.getNodeId(),
      };
      const claimCtoB: ClaimLinkNode = {
        type: 'node',
        node1: nodeC.nodeManager.getNodeId(),
        node2: nodeB.nodeManager.getNodeId(),
      };
      await nodeB.sigchain.addClaim(claimBtoC);
      await nodeB.sigchain.addClaim(claimCtoB);
      await nodeC.sigchain.addClaim(claimCtoB);
      await nodeC.sigchain.addClaim(claimBtoC);

Here we're incorrectly adding 2 claims, that are singly signed by the owner of the respective sigchain the claim is added to. From the git blame, it seems like this was added prior to the refactoring of node claims though, so just something that's been missed.

Additional context

Tasks

  1. Create a tests utility function to create a node claim (a doubly signed claim, signed by both nodes' private keys).
  2. Find and fix all instances where the nodes claims are being incorrectly set up.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions