Skip to content

Commit

Permalink
fix: add tx_submitter
Browse files Browse the repository at this point in the history
  • Loading branch information
dvilelaf committed May 23, 2024
1 parent 49e2955 commit f7c9e26
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/valory/skills/learning_abci/payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ class DecisionMakingPayload(BaseTxPayload):
class TxPreparationPayload(BaseTxPayload):
"""Represent a transaction payload for the TxPreparationRound."""

tx_hash: str
tx_submitter: Optional[str] = None
tx_hash: Optional[str] = None
10 changes: 9 additions & 1 deletion packages/valory/skills/learning_abci/rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ def participant_to_tx_round(self) -> DeserializedCollection:
"""Get the participants to the tx round."""
return self._get_deserialized("participant_to_tx_round")

@property
def tx_submitter(self) -> str:
"""Get the round that submitted a tx to transaction_settlement_abci."""
return str(self.db.get_strict("tx_submitter"))


class APICheckRound(CollectSameUntilThresholdRound):
"""APICheckRound"""
Expand Down Expand Up @@ -128,7 +133,10 @@ class TxPreparationRound(CollectSameUntilThresholdRound):
done_event = Event.DONE
no_majority_event = Event.NO_MAJORITY
collection_key = get_name(SynchronizedData.participant_to_tx_round)
selection_key = get_name(SynchronizedData.most_voted_tx_hash)
selection_key = (
get_name(SynchronizedData.tx_submitter),
get_name(SynchronizedData.most_voted_tx_hash),
)

# Event.ROUND_TIMEOUT # this needs to be referenced for static checkers

Expand Down

0 comments on commit f7c9e26

Please sign in to comment.