Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
name: 'Server',
username: 'server',
token: 'token',
isGuest: false,
};
device = {
claims: {
[USERNAME_CLAIM]: 'server',
[DEVICE_ID_CLAIM]: 'serverDeviceId',
[SESSION_ID_CLAIM]: 'serverSessionId',
},
roles: [SERVER_ROLE],
};
store = new TestCausalTreeStore();
factory = auxCausalTreeFactory();
crypto = new TestCryptoImpl('ECDSA-SHA256-NISTP256');
crypto.valid = true;
manager = new AuxChannelManagerImpl(
user,
device,
store,
factory,
crypto,
[]
);
stored = new AuxCausalTree(storedTree(site(1)));
await stored.root();
store.put('test', stored.export());
});
beforeEach(async () => {
store = new TestCausalTreeStore();
factory = new CausalTreeFactory({
number: (stored, options) =>
new Tree(stored, new NumberReducer(), options),
broken: (stored, options) =>
new BrokenTree(stored, new NumberReducer(), options),
});
crypto = new TestCryptoImpl('ECDSA-SHA256-NISTP256');
crypto.valid = true;
manager = new ChannelManagerImpl(store, factory, crypto);
stored = new Tree(storedTree(site(1)), new NumberReducer());
await stored.create(new Op(), null);
store.put('test', stored.export());
stored = new Tree(storedTree(site(1)), new NumberReducer());
await stored.create(new Op(), null);
store.put('test02', stored.export());
store.put(
'broken',
storedTree(
site(1),
[site(1)],