Files
common/packages/util-rlp/test/getTests.ts
T
Jaco Greeff cf570fd729 Make isLe required in conversion (#180)
* Make isLe required in conversion

* Update logger Date format

* Fallback encoding sizes
2018-07-27 12:03:11 +02:00

21 lines
638 B
TypeScript

// Copyright 2017-2018 @polkadot/util-rlp authors & contributors
// This software may be modified and distributed under the terms
// of the MPL-2.0 license. See the LICENSE file for details.
import BN from 'bn.js';
import { getSingleFile } from 'ethereumjs-testing';
import bnToU8a from '@polkadot/util/bn/toU8a';
export default function getTests (file: string) {
const tests = getSingleFile(file);
return Object.keys(tests).map((name) => ({
name,
input: tests[name].in[0] !== '#'
? tests[name].in
: bnToU8a(new BN(tests[name].in.slice(1)), -1, true),
output: `0x${tests[name].out.toLowerCase()}`
}));
}