Added better errors when calling contracts with incorrect number of arguments.

This commit is contained in:
Richard Moore 2018-04-05 15:47:34 -04:00
parent 12b68b0242
commit 03f8c1db86
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295

View File

@ -76,6 +76,10 @@ function Contract(addressOrName, contractInterface, signerOrProvider) {
throw new Error('unknown transaction override ' + key);
}
}
} else if (params.length > method.inputs.types.length) {
throw new Error('too many parameters');
} else if (params.length < method.inputs.types.length) {
throw new Error('too few parameters');
}
// Check overrides make sense