autonity / aut

A command-line RPC client for Autonity
MIT License
11 stars 10 forks source link

`contract call` to `Accountability.abi` `getValidatorFaults` throws `TypeError`s for JSON serialization and encoding #141

Closed cmjc closed 5 months ago

cmjc commented 7 months ago

Bug Calling the Accountability Contract Interface function getValidatorFaults to a validator with slashing history using aut contract call fails throwing TypeErrors for JSON serialization and encoding.

Expected behaviour The method returns without error, the response being:

For example, a call to getValidatorFaults on a validator with slashing history returns so:

aut contract call --address 0x5a443704dd4B594B382c22a083e2BD3090A6feF3 getValidatorFaults 0xaf86859ea7e36f580d2702caeeaf7a79a3838449
TypeError: Object of type bytes is not JSON serializable

During handling of the above exception, another exception occurred:

TypeError: list had unencodable value at index: [0: because (dict had unencodable value at keys: {'rawProof': because (Object of type bytes is not JSON serializable)})]

During handling of the above exception, another exception occurred:

TypeError: Could not encode to JSON: list had unencodable value at index: [0: because (dict had unencodable value at keys: {'rawProof': because (Object of type bytes is not JSON serializable)})]
szemate commented 5 months ago

Fixed by autonity/autonity.py#46.