* WIP on bounties derive. * wip * Some basic tests for derive bounties * Simplify bounties derive and mocks * Get bounties and descriptions * Allow for empty bounties. Refactor tests. * Move tests to test directory * Attempt to remove duplication * Sort imports * Reorganize tests * Change returned type
19 lines
591 B
TypeScript
19 lines
591 B
TypeScript
// Copyright 2017-2020 @polkadot/api authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import { ApiPromise, WsProvider } from '@polkadot/api';
|
|
import { Metadata } from '@polkadot/metadata';
|
|
import metaStatic from '@polkadot/metadata/static';
|
|
import { TypeRegistry } from '@polkadot/types';
|
|
|
|
export function createApiWithAugmentations (): ApiPromise {
|
|
const registry = new TypeRegistry();
|
|
const metadata = new Metadata(registry, metaStatic);
|
|
|
|
const api = new ApiPromise({ provider: new WsProvider('ws://', false) });
|
|
|
|
api.injectMetadata(metadata, true);
|
|
|
|
return api;
|
|
}
|