Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
executeMethod(abiItemModel, methodArguments, requestType) {
let method;
try {
method = this.createMethod(abiItemModel, methodArguments, requestType);
} catch (error) {
const promiEvent = new PromiEvent();
method = this.methodFactory.createMethodByRequestType(abiItemModel, this.contract, requestType);
method.setArguments(methodArguments);
if (isFunction(method.callback)) {
method.callback(error, null);
}
promiEvent.reject(error);
promiEvent.emit('error', error);
return promiEvent;
}
return method.execute();
}
executeMethod(abiItemModel, methodArguments, requestType) {
let method;
try {
method = this.createMethod(abiItemModel, methodArguments, requestType);
} catch (error) {
const promiEvent = new PromiEvent();
promiEvent.reject(error);
promiEvent.emit('error', error);
return promiEvent;
}
return method.execute();
}