Merge pull request #3459 from ethcore/ng-abi-fallback
Add fallback check in ABI validation
This commit is contained in:
commit
4d5ce8fde4
@ -44,7 +44,7 @@ export function validateAbi (abi, api) {
|
||||
|
||||
// Validate each elements of the Array
|
||||
const invalidIndex = abiParsed
|
||||
.map((o) => isValidAbiEvent(o, api) || isValidAbiFunction(o, api))
|
||||
.map((o) => isValidAbiEvent(o, api) || isValidAbiFunction(o, api) || isAbiFallback(o))
|
||||
.findIndex((valid) => !valid);
|
||||
|
||||
if (invalidIndex !== -1) {
|
||||
@ -74,6 +74,14 @@ function isValidAbiFunction (object, api) {
|
||||
(object.inputs && api.util.isArray(object.inputs));
|
||||
}
|
||||
|
||||
function isAbiFallback (object) {
|
||||
if (!object) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return object.type === 'fallback';
|
||||
}
|
||||
|
||||
function isValidAbiEvent (object, api) {
|
||||
if (!object) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user