{address,u8a}Eq functions (#606)

* {addres,u8a}Eq functions

* Remove mnemonicToSeed
This commit is contained in:
Jaco Greeff
2020-05-31 14:19:10 +02:00
committed by GitHub
parent 3351fb1cba
commit 1f3dd60a8d
15 changed files with 1678 additions and 985 deletions
+43
View File
@@ -0,0 +1,43 @@
// Copyright 2017-2020 @polkadot/util authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import { u8aEq } from '.';
describe('u8aEq', (): void => {
it('returns false when the lengths do not match', (): void => {
expect(
u8aEq(
new Uint8Array([1, 2, 3]),
new Uint8Array([1, 2])
)
).toEqual(false);
});
it('returns false when the contents do not match', (): void => {
expect(
u8aEq(
new Uint8Array([1, 2, 3]),
new Uint8Array([1, 2, 4])
)
).toEqual(false);
});
it('returns true when the contents do match', (): void => {
expect(
u8aEq(
new Uint8Array([1, 2, 3]),
new Uint8Array([1, 2, 3])
)
).toEqual(true);
});
it('returns true with equalvalent hex & Uint8array', (): void => {
expect(
u8aEq(
'0x010203',
new Uint8Array([1, 2, 3])
)
).toEqual(true);
});
});