From 9b624a884bebc1775f5777a0845d5f093defd038 Mon Sep 17 00:00:00 2001 From: Greg Hysen Date: Wed, 11 Apr 2018 10:24:33 -0700 Subject: snake case to camel case --- packages/contracts/src/utils/asset_proxy_utils.ts | 50 +++++++++++------------ 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'packages') diff --git a/packages/contracts/src/utils/asset_proxy_utils.ts b/packages/contracts/src/utils/asset_proxy_utils.ts index 938110a75..e3d2ff55c 100644 --- a/packages/contracts/src/utils/asset_proxy_utils.ts +++ b/packages/contracts/src/utils/asset_proxy_utils.ts @@ -8,60 +8,60 @@ export function zeroPad(value: string, width: number): string { return '0'.repeat(width - value.length) + value; } -export function encodeAssetProxyId(assetProxyId: AssetProxyId, encoded_metadata: { value: string }) { - encoded_metadata.value += zeroPad(new BigNumber(assetProxyId).toString(16), 2); +export function encodeAssetProxyId(assetProxyId: AssetProxyId, encodedMetadata: { value: string }) { + encodedMetadata.value += zeroPad(new BigNumber(assetProxyId).toString(16), 2); } -export function encodeAddress(address: string, encoded_metadata: { value: string }) { - encoded_metadata.value += zeroPad(address.replace('0x', ''), 40); +export function encodeAddress(address: string, encodedMetadata: { value: string }) { + encodedMetadata.value += zeroPad(address.replace('0x', ''), 40); } -export function encodeUint256(value: BigNumber, encoded_metadata: { value: string }) { - encoded_metadata.value += zeroPad(value.toString(16), 64); +export function encodeUint256(value: BigNumber, encodedMetadata: { value: string }) { + encodedMetadata.value += zeroPad(value.toString(16), 64); } export function encodeERC20ProxyMetadata_V1(tokenAddress: string) { // Encode metadata - const encoded_metadata = { value: '0x' }; - encodeAssetProxyId(AssetProxyId.ERC20_V1, encoded_metadata); - encodeAddress(tokenAddress, encoded_metadata); + const encodedMetadata = { value: '0x' }; + encodeAssetProxyId(AssetProxyId.ERC20_V1, encodedMetadata); + encodeAddress(tokenAddress, encodedMetadata); // Verify encoding length - '0x' plus 21 bytes of encoded data - if (encoded_metadata.value.length != 44) { - throw Error('Bad encoding length. Expected 44, got ' + encoded_metadata.value.length); + if (encodedMetadata.value.length != 44) { + throw Error('Bad encoding length. Expected 44, got ' + encodedMetadata.value.length); } // Return encoded metadata - return encoded_metadata.value; + return encodedMetadata.value; } export function encodeERC20ProxyMetadata(tokenAddress: string) { // Encode metadata - const encoded_metadata = { value: '0x' }; - encodeAssetProxyId(AssetProxyId.ERC20, encoded_metadata); - encodeAddress(tokenAddress, encoded_metadata); + const encodedMetadata = { value: '0x' }; + encodeAssetProxyId(AssetProxyId.ERC20, encodedMetadata); + encodeAddress(tokenAddress, encodedMetadata); // Verify encoding length - '0x' plus 21 bytes of encoded data - if (encoded_metadata.value.length != 44) { - throw Error('Bad encoding length. Expected 44, got ' + encoded_metadata.value.length); + if (encodedMetadata.value.length != 44) { + throw Error('Bad encoding length. Expected 44, got ' + encodedMetadata.value.length); } // Return encoded metadata - return encoded_metadata.value; + return encodedMetadata.value; } export function encodeERC721ProxyMetadata(tokenAddress: string, tokenId: BigNumber) { // Encode metadata - const encoded_metadata = { value: '0x' }; - encodeAssetProxyId(AssetProxyId.ERC721, encoded_metadata); - encodeAddress(tokenAddress, encoded_metadata); - encodeUint256(tokenId, encoded_metadata); + const encodedMetadata = { value: '0x' }; + encodeAssetProxyId(AssetProxyId.ERC721, encodedMetadata); + encodeAddress(tokenAddress, encodedMetadata); + encodeUint256(tokenId, encodedMetadata); // Verify encoding length - '0x' plus 53 bytes of encoded data - if (encoded_metadata.value.length != 108) { - throw Error('Bad encoding length. Expected 108, got ' + encoded_metadata.value.length); + if (encodedMetadata.value.length != 108) { + throw Error('Bad encoding length. Expected 108, got ' + encodedMetadata.value.length); } // Return encoded metadata - return encoded_metadata.value; + return encodedMetadata.value; } -- cgit