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
- Create a
tests utility function to create a node claim (a doubly signed claim, signed by both nodes' private keys).
- Find and fix all instances where the nodes claims are being incorrectly set up.
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,
BandC, 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 bothBandC). That is,Bwill have a single claim signed by both itself andC, andCwill have a single claim signed by both itself andB.However, there are some tests that aren't setting this up correctly. For example, in
tests/bin/identities.test.ts: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
pk identities claimcommand to augment DIs #278 (comment)Tasks
testsutility function to create a node claim (a doubly signed claim, signed by both nodes' private keys).