util.spec.ts 662 B

12345678910111213141516171819
  1. // Copyright 2017-2019 @polkadot/react-components authors & contributors
  2. // This software may be modified and distributed under the terms
  3. // of the Apache-2.0 license. See the LICENSE file for details.
  4. import { hexToU8a } from '@polkadot/util';
  5. import { publicToAddr } from './util';
  6. describe('publicToAddr', (): void => {
  7. it('converts a publicKey to address', (): void => {
  8. expect(
  9. publicToAddr(
  10. hexToU8a(
  11. '0x836b35a026743e823a90a0ee3b91bf615c6a757e2b60b9e1dc1826fd0dd16106f7bc1e8179f665015f43c6c81f39062fc2086ed849625c06e04697698b21855e'
  12. )
  13. )
  14. ).toEqual('0x0BED7ABd61247635c1973eB38474A2516eD1D884');
  15. });
  16. });