Commit d2f744aa authored by aniket-engg's avatar aniket-engg Committed by Aniket

removing any type

parent 122a8dc3
...@@ -36,8 +36,8 @@ export function encodeData (funABI, values, contractbyteCode) { ...@@ -36,8 +36,8 @@ export function encodeData (funABI, values, contractbyteCode) {
* @param {Function} callback - callback * @param {Function} callback - callback
*/ */
export function encodeParams (params, funAbi, callback) { export function encodeParams (params, funAbi, callback) {
let data: any = '' let data: Buffer | string = ''
let dataHex = '' let dataHex: string = ''
let funArgs let funArgs
if (params.indexOf('raw:0x') === 0) { if (params.indexOf('raw:0x') === 0) {
// in that case we consider that the input is already encoded and *does not* contain the method signature // 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) { ...@@ -54,7 +54,7 @@ export function encodeParams (params, funAbi, callback) {
if (funArgs.length > 0) { if (funArgs.length > 0) {
try { try {
data = encodeParamsHelper(funAbi, funArgs) data = encodeParamsHelper(funAbi, funArgs)
dataHex = data.toString('hex') dataHex = data.toString()
} catch (e) { } catch (e) {
return callback('Error encoding arguments: ' + e) return callback('Error encoding arguments: ' + e)
} }
...@@ -166,8 +166,8 @@ export function encodeConstructorCallAndDeployLibraries (contractName, contract, ...@@ -166,8 +166,8 @@ export function encodeConstructorCallAndDeployLibraries (contractName, contract,
*/ */
export function buildData (contractName, contract, contracts, isConstructor, funAbi, params, callback, callbackStep, callbackDeployLibrary) { export function buildData (contractName, contract, contracts, isConstructor, funAbi, params, callback, callbackStep, callbackDeployLibrary) {
let funArgs = [] let funArgs = []
let data: any = '' let data: Buffer | string = ''
let dataHex = '' let dataHex: string = ''
if (params.indexOf('raw:0x') === 0) { if (params.indexOf('raw:0x') === 0) {
// in that case we consider that the input is already encoded and *does not* contain the method signature // 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 ...@@ -183,7 +183,7 @@ export function buildData (contractName, contract, contracts, isConstructor, fun
} }
try { try {
data = encodeParamsHelper(funAbi, funArgs) data = encodeParamsHelper(funAbi, funArgs)
dataHex = data.toString('hex') dataHex = data.toString()
} catch (e) { } catch (e) {
return callback('Error encoding arguments: ' + e) return callback('Error encoding arguments: ' + e)
} }
......
...@@ -167,9 +167,9 @@ export function sha3_256 (value) { ...@@ -167,9 +167,9 @@ export function sha3_256 (value) {
if (typeof value === 'string' && value.indexOf('0x') !== 0) { if (typeof value === 'string' && value.indexOf('0x') !== 0) {
value = '0x' + value value = '0x' + value
} }
let ret: any = bufferToHex(setLengthLeft(value, 32)) const ret: string = bufferToHex(setLengthLeft(value, 32))
ret = keccak(ret) const retInBuffer: Buffer = keccak(ret)
return bufferToHex(ret) return bufferToHex(retInBuffer)
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment