-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aded020
commit dc58f15
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const { promisify: p } = require('util') | ||
const test = require('tape') | ||
const { keySchemes } = require('private-group-spec') | ||
const { Server } = require('../../helpers') | ||
|
||
test('can set and get own self dm key', async (t) => { | ||
const alice = Server() | ||
|
||
const ownKey = Buffer.from( | ||
'30720d8f9cbf37f6d7062826f6decac93e308060a8aaaa77e6a4747f40ee1a76', | ||
'hex' | ||
) | ||
|
||
alice.tribes.ownKeys.register(ownKey) | ||
|
||
const gottenKeyList = await p(alice.tribes.ownKeys.list)() | ||
const gottenKey = gottenKeyList[0] | ||
|
||
t.equal(gottenKey.key, ownKey, 'got correct key') | ||
t.equal(gottenKey.scheme, keySchemes.feed_id_self, 'got correct scheme') | ||
|
||
await p(alice.close)() | ||
}) |