Update dependencies

This commit is contained in:
Jaco Greeff
2018-08-16 11:53:54 +02:00
parent c02364c3de
commit d47fd44c39
13 changed files with 1950 additions and 1243 deletions
+11
View File
@@ -0,0 +1,11 @@
declare module 'ethereumjs-testing' {
type Tests = {
[index: string]: {
in: string,
out: string,
root: string
}
};
export const getSingleFile: (name: string) => Tests;
}
+23
View File
@@ -0,0 +1,23 @@
// 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: tests[name].out
? `0x${tests[name].out.toLowerCase()}`
: undefined,
root: tests[name].root
}));
}