From 0ec2092f9f2763039815c86d00c3031e9dc67ce5 Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Fri, 4 Dec 2020 13:21:55 +0530 Subject: [PATCH] removing any type --- libs/remix-lib/src/execution/txFormat.ts | 12 ++++++------ libs/remix-lib/src/util.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/remix-lib/src/execution/txFormat.ts b/libs/remix-lib/src/execution/txFormat.ts index 24c144839d..9578373026 100644 --- a/libs/remix-lib/src/execution/txFormat.ts +++ b/libs/remix-lib/src/execution/txFormat.ts @@ -36,8 +36,8 @@ export function encodeData (funABI, values, contractbyteCode) { * @param {Function} callback - callback */ export function encodeParams (params, funAbi, callback) { - let data: any = '' - let dataHex = '' + let data: Buffer | string = '' + let dataHex: string = '' let funArgs if (params.indexOf('raw:0x') === 0) { // in that case we consider that the input is already encoded and *does not* contain the method signature @@ -54,7 +54,7 @@ export function encodeParams (params, funAbi, callback) { if (funArgs.length > 0) { try { data = encodeParamsHelper(funAbi, funArgs) - dataHex = data.toString('hex') + dataHex = data.toString() } catch (e) { return callback('Error encoding arguments: ' + e) } @@ -166,8 +166,8 @@ export function encodeConstructorCallAndDeployLibraries (contractName, contract, */ export function buildData (contractName, contract, contracts, isConstructor, funAbi, params, callback, callbackStep, callbackDeployLibrary) { let funArgs = [] - let data: any = '' - let dataHex = '' + let data: Buffer | string = '' + let dataHex: string = '' if (params.indexOf('raw:0x') === 0) { // in that case we consider that the input is already encoded and *does not* contain the method signature @@ -183,7 +183,7 @@ export function buildData (contractName, contract, contracts, isConstructor, fun } try { data = encodeParamsHelper(funAbi, funArgs) - dataHex = data.toString('hex') + dataHex = data.toString() } catch (e) { return callback('Error encoding arguments: ' + e) } diff --git a/libs/remix-lib/src/util.ts b/libs/remix-lib/src/util.ts index 4e88ee381e..143d099a1d 100644 --- a/libs/remix-lib/src/util.ts +++ b/libs/remix-lib/src/util.ts @@ -167,9 +167,9 @@ export function sha3_256 (value) { if (typeof value === 'string' && value.indexOf('0x') !== 0) { value = '0x' + value } - let ret: any = bufferToHex(setLengthLeft(value, 32)) - ret = keccak(ret) - return bufferToHex(ret) + const ret: string = bufferToHex(setLengthLeft(value, 32)) + const retInBuffer: Buffer = keccak(ret) + return bufferToHex(retInBuffer) } /**