• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hyperledger / identus-edge-agent-sdk-ts / 10846586315

13 Sep 2024 09:24AM UTC coverage: 72.279% (+0.1%) from 72.134%
10846586315

push

github

web-flow
feat: separate DIDCommAgent and adding Tasks (#277)

Signed-off-by: Curtish <ch@curtish.me>

1404 of 2142 branches covered (65.55%)

Branch coverage included in aggregate %.

238 of 398 new or added lines in 19 files covered. (59.8%)

5 existing lines in 1 file now uncovered.

2833 of 3720 relevant lines covered (76.16%)

24.1 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/edge-agent/didFunctions/Sign.ts
1
import * as Domain from "../../domain";
2
import { Task } from "../../utils/tasks";
3

4
/**
5
 * Asyncronously sign with a DID
6
 *
7
 * @async
8
 * @param {DID} did
9
 * @param {Uint8Array} message
10
 * @returns {Promise<Signature>}
11
 */
12

13
interface Args {
14
  did: Domain.DID;
15
  message: Uint8Array;
16
}
17

18
export class SignWithDID extends Task<Domain.Signature, Args> {
19
  async run(ctx: Task.Context) {
NEW
20
    const privateKeys = await ctx.Pluto.getDIDPrivateKeysByDID(this.args.did);
×
21

NEW
22
    for (const privateKey of privateKeys) {
×
NEW
23
      if (privateKey.isSignable()) {
×
NEW
24
        return {
×
25
          value: privateKey.sign(Buffer.from(this.args.message)),
26
        };
27
      }
28
    }
29

NEW
30
    throw new Domain.AgentError.CannotFindDIDPrivateKey();
×
31
  }
32
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc