Skip to content

Commit

Permalink
test: update the cases for CallCheckpointPayload
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Dec 11, 2024
1 parent c4b604a commit e0d9f7a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/valory/skills/staking_abci/tests/test_payloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
"service_staking_state": 1,
"tx_submitter": "dummy tx submitter",
"tx_hash": "dummy tx hash",
"ts_checkpoint": 1,
"is_checkpoint_reached": True,
},
),
],
Expand Down
12 changes: 12 additions & 0 deletions packages/valory/skills/staking_abci/tests/test_rounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def abci_app() -> StakingAbciApp:
"service_staking_state": StakingState.UNSTAKED.value,
"tx_submitter": "dummy_submitter",
"tx_hash": "dummy_tx_hash",
"ts_checkpoint": 0,
"is_checkpoint_reached": True,
}


Expand Down Expand Up @@ -148,12 +150,16 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass):
"service_staking_state": StakingState.STAKED.value,
"tx_submitter": "dummy_submitter",
"tx_hash": "dummy_tx_hash",
"ts_checkpoint": 0,
"is_checkpoint_reached": True,
}
),
final_data={
"service_staking_state": StakingState.STAKED.value,
"tx_submitter": "dummy_submitter",
"tx_hash": "dummy_tx_hash",
"ts_checkpoint": 0,
"is_checkpoint_reached": True,
},
event=Event.DONE,
most_voted_payload=DUMMY_SERVICE_STATE["tx_submitter"],
Expand Down Expand Up @@ -184,6 +190,8 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass):
"service_staking_state": StakingState.EVICTED.value,
"tx_submitter": "dummy_submitter",
"tx_hash": "dummy_tx_hash",
"ts_checkpoint": 0,
"is_checkpoint_reached": True,
}
),
final_data={},
Expand All @@ -202,6 +210,8 @@ class TestCallCheckpointRound(BaseStakingRoundTestClass):
"service_staking_state": StakingState.STAKED.value,
"tx_submitter": "dummy_submitter",
"tx_hash": None,
"ts_checkpoint": 0,
"is_checkpoint_reached": True,
}
),
final_data={},
Expand Down Expand Up @@ -279,6 +289,8 @@ def test_staking_abci_app_initialization(abci_app: StakingAbciApp) -> None:
get_name(SynchronizedData.tx_submitter),
get_name(SynchronizedData.most_voted_tx_hash),
get_name(SynchronizedData.service_staking_state),
get_name(SynchronizedData.previous_checkpoint),
get_name(SynchronizedData.is_checkpoint_reached),
},
FinishedStakingRound: {
get_name(SynchronizedData.service_staking_state),
Expand Down

0 comments on commit e0d9f7a

Please sign in to comment.