@0x:contracts-staking
Addressed review comments
This commit is contained in:
@@ -44,6 +44,14 @@ export function hexInvert(n: string | BigNumber | number, size: number = WORD_LE
|
||||
return ethUtil.bufferToHex(Buffer.from(buf.map(b => ~b)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Slices off the desired number of bytes from a hex number.
|
||||
*/
|
||||
export function hexSlice(n: string | BigNumber | number, size: number): string {
|
||||
const hex = toHex(n);
|
||||
return '0x'.concat(toHex(n).slice(size * 2 + 2, hex.length));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a string, a number, or a BigNumber into a hex string.
|
||||
* Works with negative numbers, as well.
|
||||
|
@@ -28,7 +28,7 @@ export { bytes32Values, testCombinatoriallyWithReferenceFunc, uint256Values } fr
|
||||
export { TransactionFactory } from './transaction_factory';
|
||||
export { MutatorContractFunction, TransactionHelper } from './transaction_helper';
|
||||
export { testWithReferenceFuncAsync } from './test_with_reference';
|
||||
export { hexConcat, hexLeftPad, hexInvert, hexRandom, hexRightPad, toHex } from './hex_utils';
|
||||
export { hexConcat, hexLeftPad, hexInvert, hexSlice, hexRandom, hexRightPad, toHex } from './hex_utils';
|
||||
export {
|
||||
BatchMatchOrder,
|
||||
ContractName,
|
||||
|
Reference in New Issue
Block a user