-
Notifications
You must be signed in to change notification settings - Fork 29
Open
Labels
Description
According to Realitio docs, only the latest history hash is stored in the question struct:
Empty Bytes32 + Answer + Bond + Answerer + False -> History Hash 1
History Hash 1 + Answer + Bond + Answerer + False -> History Hash 2
History Hash 2 + Answer + Bond + Answerer + False -> History Hash 3 <- stored in Questions struct
If multiple answers were submitted, and we query them on subgraph, we can see it:
All the returned history hashes are the same. (it's this question)
And that's why the following code https://github.com/kongzii/trader/blob/main/packages/valory/skills/market_manager_abci/graph_tooling/requests.py#L297:
answers = [
{
"args": {
"answer": bytes.fromhex(answer["answer"][2:]),
"question_id": bytes.fromhex(answer["question"]["questionId"][2:]),
"history_hash": bytes.fromhex(
answer["question"]["historyHash"][2:]
),
"user": Web3.to_checksum_address(answer["question"]["user"]),
"bond": int(answer["bondAggregate"]),
"timestamp": int(answer["timestamp"]),
"is_commitment": False,
}
}
for answer in raw_answers
]
submits invalid hashes if there are multiple different answers and claiming of bonds fails.
Reactions are currently unavailable
