mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2837 from ethereum/event-overloading-abi
Include all overloaded events in ABI
This commit is contained in:
commit
b364bd048f
@ -5,9 +5,9 @@ Features:
|
|||||||
* Type Checker: Warn on using literals as tight packing parameters in ``keccak256``, ``sha3``, ``sha256`` and ``ripemd160``.
|
* Type Checker: Warn on using literals as tight packing parameters in ``keccak256``, ``sha3``, ``sha256`` and ``ripemd160``.
|
||||||
|
|
||||||
Bugfixes:
|
Bugfixes:
|
||||||
|
* ABI JSON: Include all overloaded events.
|
||||||
* Parser: Crash fix related to parseTypeName.
|
* Parser: Crash fix related to parseTypeName.
|
||||||
|
|
||||||
|
|
||||||
### 0.4.16 (2017-08-24)
|
### 0.4.16 (2017-08-24)
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
@ -176,11 +176,19 @@ vector<EventDefinition const*> const& ContractDefinition::interfaceEvents() cons
|
|||||||
m_interfaceEvents.reset(new vector<EventDefinition const*>());
|
m_interfaceEvents.reset(new vector<EventDefinition const*>());
|
||||||
for (ContractDefinition const* contract: annotation().linearizedBaseContracts)
|
for (ContractDefinition const* contract: annotation().linearizedBaseContracts)
|
||||||
for (EventDefinition const* e: contract->events())
|
for (EventDefinition const* e: contract->events())
|
||||||
if (eventsSeen.count(e->name()) == 0)
|
{
|
||||||
|
/// NOTE: this requires the "internal" version of an Event,
|
||||||
|
/// though here internal strictly refers to visibility,
|
||||||
|
/// and not to function encoding (jump vs. call)
|
||||||
|
auto const& function = e->functionType(true);
|
||||||
|
solAssert(function, "");
|
||||||
|
string eventSignature = function->externalSignature();
|
||||||
|
if (eventsSeen.count(eventSignature) == 0)
|
||||||
{
|
{
|
||||||
eventsSeen.insert(e->name());
|
eventsSeen.insert(eventSignature);
|
||||||
m_interfaceEvents->push_back(e);
|
m_interfaceEvents->push_back(e);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return *m_interfaceEvents;
|
return *m_interfaceEvents;
|
||||||
}
|
}
|
||||||
|
@ -423,6 +423,8 @@ BOOST_AUTO_TEST_CASE(events)
|
|||||||
function f(uint a) returns(uint d) { return a * 7; }
|
function f(uint a) returns(uint d) { return a * 7; }
|
||||||
event e1(uint b, address indexed c);
|
event e1(uint b, address indexed c);
|
||||||
event e2();
|
event e2();
|
||||||
|
event e2(uint a);
|
||||||
|
event e3() anonymous;
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
char const* interface = R"([
|
char const* interface = R"([
|
||||||
@ -467,6 +469,24 @@ BOOST_AUTO_TEST_CASE(events)
|
|||||||
"type": "event",
|
"type": "event",
|
||||||
"anonymous": false,
|
"anonymous": false,
|
||||||
"inputs": []
|
"inputs": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "e2",
|
||||||
|
"type": "event",
|
||||||
|
"anonymous": false,
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"indexed": false,
|
||||||
|
"name": "a",
|
||||||
|
"type": "uint256"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "e3",
|
||||||
|
"type": "event",
|
||||||
|
"anonymous": true,
|
||||||
|
"inputs": []
|
||||||
}
|
}
|
||||||
|
|
||||||
])";
|
])";
|
||||||
|
Loading…
Reference in New Issue
Block a user