Pad to 32 if asset ids are small

This commit is contained in:
Jacob Evans
2018-05-10 15:59:44 +10:00
parent 9744b1906a
commit f9d2689a12

View File

@@ -18,7 +18,8 @@ export const assetProxyUtils = {
encodeUint256(value: BigNumber): Buffer {
const formattedValue = new BN(value.toString(10));
const encodedValue = ethUtil.toBuffer(formattedValue);
return encodedValue;
const paddedValue = ethUtil.setLengthLeft(encodedValue, 32);
return paddedValue;
},
encodeERC20ProxyData(tokenAddress: string): string {
const encodedAssetProxyId = assetProxyUtils.encodeAssetProxyId(AssetProxyId.ERC20);