Added better errors when calling contracts with incorrect number of arguments.
This commit is contained in:
parent
12b68b0242
commit
03f8c1db86
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user