removing any type

pull/5370/head
aniket-engg 4 years ago committed by Aniket
parent 21f2ae02de
commit 0ec2092f9f
  1. 12
      libs/remix-lib/src/execution/txFormat.ts
  2. 6
      libs/remix-lib/src/util.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)
}

@ -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)
}
/**

Loading…
Cancel
Save