/* External Imports */
import { BigNumber } from 'ethers'
export const getLen = (pos: { start; end }) => (pos.end - pos.start) * 2
export const encodeHex = (val: any, len: number) =>
remove0x(BigNumber.from(val).toHexString()).padStart(len, '0')
export const toVerifiedBytes = (val: string, len: number) => {
val = remove0x(val)
if (val.length !== len) {
throw new Error('Invalid length!')
}
return val
}
export const remove0x = (str: string): string => {
if (str.startsWith('0x')) {
return str.slice(2)
} else {
return str
}
}
-
smartcontracts authored
* pkg: Add batch submitter * chore(batch-submitter): fix configs * chore(batch-submitter): use latest smock * fix: use latest typescript * chore: disable prettier in incompat lines Long term fixed by switching to eslint * perf: only test packages that have changed since master https://github.com/lerna/lerna/tree/main/core/filter-options\#--since-refCo-authored-by:
Georgios Konstantopoulos <me@gakonst.com>
550a2f69