Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3459 from ethcore/ng-abi-fallback
Browse files Browse the repository at this point in the history
Add fallback check in ABI validation
  • Loading branch information
gavofyork authored Nov 16, 2016
2 parents 130fd3f + 3b8286f commit 4d5ce8f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion js/src/util/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 4d5ce8f

Please sign in to comment.