Adjust encoder/decoder fallbacks (#750)

* Adjust encoder/decoder fallbacks

* Dep-dup is functions

* Complexity cleanups
This commit is contained in:
Jaco Greeff
2020-11-08 11:20:22 +01:00
committed by GitHub
parent e1aa096cef
commit c67c1966d7
18 changed files with 118 additions and 78 deletions
@@ -0,0 +1,20 @@
// Copyright 2017-2020 @polkadot/x-randomvalues authors & contributors
// SPDX-License-Identifier: Apache-2.0
import fallback from './fallback';
describe('fallback (insecure)', (): void => {
it('subsequent results does not match', (): void => {
expect(
fallback(new Uint8Array(32)).toString()
).not.toEqual(
fallback(new Uint8Array(32)).toString()
);
});
it('generates with the supplied length', (): void => {
expect(
fallback(new Uint8Array(128))
).toHaveLength(128);
});
});