Remove from* variants, move fromString to stringTo (#233)

* Remove from* variants, move fromString to stringTo

* Bump
This commit is contained in:
Jaco Greeff
2018-10-18 10:30:14 +02:00
committed by GitHub
parent 35579c4d70
commit 57eddba598
56 changed files with 69 additions and 378 deletions
@@ -3,7 +3,7 @@
// of the ISC license. See the LICENSE file for details.
import hexToU8a from '@polkadot/util/hex/toU8a';
import u8aFromString from '@polkadot/util/u8a/fromString';
import stringToU8a from '@polkadot/util/string/toU8a';
import { keccakAsU8a } from './index';
@@ -30,7 +30,7 @@ describe('keccakAsU8a', () => {
it('returns an hex representation (Uint8Array)', () => {
expect(
keccakAsU8a(
u8aFromString(input)
stringToU8a(input)
)
).toEqual(output);
});
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import u8aFromString from '@polkadot/util/u8a/fromString';
import u8aFromString from '@polkadot/util/string/toU8a';
import { naclKeypairFromSeed } from '../index';
@@ -4,7 +4,7 @@
import { KeypairType } from '../../types';
import u8aFromUtf8 from '@polkadot/util/u8a/fromUtf8';
import stringToU8a from '@polkadot/util/string/toU8a';
import blake2AsU8a from '../../blake2/asU8a';
import fromSeed from './fromSeed';
@@ -23,7 +23,7 @@ import fromSeed from './fromSeed';
export default function naclKeypairFromString (value: string): KeypairType {
return fromSeed(
blake2AsU8a(
u8aFromUtf8(value),
stringToU8a(value),
256
)
);
+1 -1
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import u8aFromString from '@polkadot/util/u8a/fromString';
import u8aFromString from '@polkadot/util/string/toU8a';
import { naclSign, naclKeypairFromSeed } from './index';
+1 -1
View File
@@ -2,7 +2,7 @@
// This software may be modified and distributed under the terms
// of the ISC license. See the LICENSE file for details.
import u8aFromString from '@polkadot/util/u8a/fromString';
import u8aFromString from '@polkadot/util/string/toU8a';
import { naclVerify, naclKeypairFromSeed } from './index';