Files
api/packages/api-derive/test/bytesFactory.ts
T
Krzysztof Jelski beccc2ed9b Derive for bounties and descriptions (#2925)
* 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
2020-12-08 13:25:30 +01:00

16 lines
405 B
TypeScript

// Copyright 2017-2020 @polkadot/api authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Bytes } from '@polkadot/types';
import { Registry } from '@polkadot/types/types';
export class BytesFactory {
#registry: Registry;
constructor (registry: Registry) {
this.#registry = registry;
}
public bytes = (value: string): Bytes => this.#registry.createType('Bytes', value);
}