Cleanup imports from @polkadot/util (#315)

* Cleanup imports from @polkadot/util

* Example imports

* Alphabetic imports
This commit is contained in:
Jaco Greeff
2018-10-18 13:30:04 +02:00
committed by GitHub
parent 8b7b76ead8
commit 55ac4626d5
22 changed files with 29 additions and 46 deletions
@@ -1,7 +1,7 @@
// Import the API, Keyring and some utility functions
const { ApiPromise } = require('@polkadot/api');
const { Keyring } = require('@polkadot/keyring');
const u8aFromUtf8 = require('@polkadot/util/u8a/fromUtf8').default;
const { stringToU8a } = require('@polkadot/util');
const ALICE_SEED = 'Alice'.padEnd(32, ' ');
const BOB_ADDR = '5Gw3s7q4QLkSWwknsiPtjujPv3XM4Trxi5d4PgKMMk3gfGTE';
@@ -11,7 +11,7 @@ async function main () {
const keyring = new Keyring();
// Add Alice to our keyring (with the known seed for the account)
const alice = keyring.addFromSeed(u8aFromUtf8(ALICE_SEED));
const alice = keyring.addFromSeed(stringToU8a(ALICE_SEED));
// Instantiate the API
const api = await ApiPromise.create();