Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(() => {
secret = createUserSecretBinary('trustchainid', 'user-id');
safe = generateKeySafe();
});
beforeEach(async () => {
dbName = `groupStore-test-${makePrefix()}`;
userSecret = createUserSecretBinary('trustchainid', 'Merkle–Damgård');
groupStoreConfig = { dbName, ...dataStoreConfig, schemas: GroupStore.schemas };
datastore = await openDataStore(groupStoreConfig);
groupStore = await GroupStore.open(datastore, userSecret);
});
static async open() {
const { generator } = await makeGenerator();
const dataStore = await makeMemoryDataStore();
const userSecret = createUserSecretBinary('trustchainid', 'userId');
const groupStore = await GroupStore.open(dataStore, userSecret);
return new GroupStoreBuilder(groupStore, generator);
}
beforeEach(async () => {
dbName = `keystore-test-${makePrefix()}`;
keystoreConfig = { ...dataStoreConfig, dbName, schemas };
datastore = await openDataStore(keystoreConfig);
secret = createUserSecretBinary('trustchainid', 'bob');
});
beforeEach(async () => {
dbName = `sharedKeystore-test-${makePrefix()}`;
userSecret = createUserSecretBinary('trustchainid', 'Merkle–Damgård');
sharedKeystoreConfig = { dbName, ...dataStoreConfig, schemas: SharedKeystore.schemas };
datastore = await openDataStore(sharedKeystoreConfig);
sharedKeystore = await SharedKeystore.open(datastore, userSecret);
});