Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions source/deth/contract.d
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,15 @@ struct ContractABI
{
assert(abi.type == JSONType.array);
JSONValue[] items = () @trusted { return abi.array; }();
foreach (i; 0 .. items.length)
foreach (item; items)
{
const type = items[i][`type`].str;
const type = item[`type`].str;
if (`function` == type)
functionFromJson(items[i]);
functionFromJson(item);
if (`constructor` == type)
constructorInputs = items[i][`inputs`].parseInputs;
constructorInputs = item[`inputs`].parseInputs;
if (`event` == type)
events = [];
eventFromJson(item);
}
}

Expand Down Expand Up @@ -306,6 +306,7 @@ struct ContractABI
ev.indexedInputTypes = item[`inputs`].parseInputs!(a => a[`indexed`].boolean);
ev.name = item[`name`].str;
keccak256(ev.sigHash, cast(ubyte[]) ev.signature.dup);
events ~= ev;
}

string toString() const pure @safe nothrow @nogc
Expand Down Expand Up @@ -417,11 +418,10 @@ private string[] parseInputs(alias filter = null)(JSONValue inputs) @safe pure
inputType = inputType.replace("tuple", input[`components`].parseTuple);
static if (isCallable!filter)
{
if (input.filter)
if (!input.filter)
continue;
}
inputTypes ~= inputType;

}
return inputTypes;
}
Expand Down