Skip to content

Commit 5a7e48c

Browse files
szemateaiman
authored andcommitted
Fix the return type & value of Accountability.events()
Due to a bug in pyabigen that has been fixed in version 0.2.12, `Accountabilty.events()` attempted to return a single `Event` instance instead of a list of `Event`s. Calling this function resulted in an exception.
1 parent d9c59db commit 5a7e48c

File tree

11 files changed

+28
-25
lines changed

11 files changed

+28
-25
lines changed

autonity/contracts/accountability.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Accountability contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import enum
66
import typing
@@ -222,7 +222,7 @@ def config(
222222
def events(
223223
self,
224224
key0: int,
225-
) -> Event:
225+
) -> typing.List[Event]:
226226
"""Binding for `events` on the Accountability contract.
227227
228228
Parameters
@@ -231,23 +231,26 @@ def events(
231231
232232
Returns
233233
-------
234-
Event
234+
typing.List[Event]
235235
"""
236236
return_value = self._contract.functions.events(
237237
key0,
238238
).call()
239-
return Event(
240-
EventType(return_value[0]),
241-
Rule(return_value[1]),
242-
eth_typing.ChecksumAddress(return_value[2]),
243-
eth_typing.ChecksumAddress(return_value[3]),
244-
hexbytes.HexBytes(return_value[4]),
245-
int(return_value[5]),
246-
int(return_value[6]),
247-
int(return_value[7]),
248-
int(return_value[8]),
249-
int(return_value[9]),
250-
)
239+
return [
240+
Event(
241+
EventType(return_value_elem[0]),
242+
Rule(return_value_elem[1]),
243+
eth_typing.ChecksumAddress(return_value_elem[2]),
244+
eth_typing.ChecksumAddress(return_value_elem[3]),
245+
hexbytes.HexBytes(return_value_elem[4]),
246+
int(return_value_elem[5]),
247+
int(return_value_elem[6]),
248+
int(return_value_elem[7]),
249+
int(return_value_elem[8]),
250+
int(return_value_elem[9]),
251+
)
252+
for return_value_elem in return_value
253+
]
251254

252255
def get_validator_accusation(
253256
self,

autonity/contracts/acu.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""ACU contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66

autonity/contracts/autonity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Autonity contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import enum
66
import typing

autonity/contracts/inflation_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""InflationController contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66
from dataclasses import dataclass

autonity/contracts/liquid_logic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""LiquidLogic contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66

autonity/contracts/omission_accountability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""OmissionAccountability contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66
from dataclasses import dataclass

autonity/contracts/oracle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Oracle contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66
from dataclasses import dataclass

autonity/contracts/stabilization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Stabilization contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66
from dataclasses import dataclass

autonity/contracts/supply_control.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""SupplyControl contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66

autonity/contracts/upgrade_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""UpgradeManager contract binding and data structures."""
22

3-
# This module has been generated using pyabigen v0.2.11
3+
# This module has been generated using pyabigen v0.2.12
44

55
import typing
66

0 commit comments

Comments
 (0)