How to use the @casual-simulation/crypto/test/TestCryptoImpl.TestCryptoImpl function in @casual-simulation/crypto

To help you get started, we’ve selected a few @casual-simulation/crypto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github casual-simulation / aux / src / aux-vm-node / managers / AuxChannelManagerImpl.spec.ts View on Github external
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());
    });
github casual-simulation / aux / src / causal-tree-server / ChannelManagerImpl.spec.ts View on Github external
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)],