Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
txObject.call = this.parent._executeMethod.bind(txObject, 'call');
txObject.call.request = this.parent._executeMethod.bind(txObject, 'call', true); // to make batch requests
}
txObject.send = this.parent._executeMethod.bind(txObject, 'send');
txObject.send.request = this.parent._executeMethod.bind(txObject, 'send', true); // to make batch requests
txObject.encodeABI = this.parent._encodeMethodABI.bind(txObject);
txObject.estimateGas = this.parent._executeMethod.bind(txObject, 'estimate');
if (args && this.method.inputs && args.length !== this.method.inputs.length) {
if (this.nextMethod) {
return this.nextMethod.apply(null, args);
}
throw errors.InvalidNumberOfParams(args.length, this.method.inputs.length, this.method.name);
}
txObject.arguments = args || [];
txObject._method = this.method;
txObject._parent = this.parent;
txObject._ethAccounts = this.parent.constructor._ethAccounts || this._ethAccounts;
if(this.deployData) {
txObject._deployData = this.deployData;
}
return txObject;
};
Subscription.prototype._validateArgs = function (args) {
var subscription = this.options.subscription;
if(!subscription)
subscription = {};
if(!subscription.params)
subscription.params = 0;
if (args.length !== subscription.params) {
throw errors.InvalidNumberOfParams(args.length, subscription.params + 1, args[0]);
}
};
validateArgs(args = []) {
if (!_.isArray(args)) {
throw errors.InvalidNumberOfParams(args.length, this.params, this.name)
}
if (args.length !== this.params) {
throw errors.InvalidNumberOfParams(args.length, this.params, this.name)
}
const result = this.validate(args)
if (!result) {
throw errors.InvalidNumberOfParams(args.length, this.params, this.name)
}
}
Subscription.prototype._validateArgs = function (args) {
var subscription = this.options.subscription;
if(!subscription)
subscription = {};
if(!subscription.params)
subscription.params = 0;
if (args.length !== subscription.params) {
throw errors.InvalidNumberOfParams(args.length, subscription.params + 1, args[0]);
}
};
_validateArgs = (...args: any[]) => {
var subscription = this.options.subscription
if (!subscription) subscription = {}
if (!subscription.params) subscription.params = 0
if (args.length !== subscription.params) {
throw errors.InvalidNumberOfParams(
args.length,
subscription.params + 1,
args[0]
)
}
}
Method.prototype.validateArgs = function (args) {
if (args.length !== this.params) {
throw errors.InvalidNumberOfParams(args.length, this.params, this.name);
}
};