Skip to content

apollo_staking: implement get_previous_epoch in CairoStakingContract#12902

Open
dafnamatsry wants to merge 1 commit intodafna/mock-staking-get-previous-epoch-datafrom
dafna/apollo-staking-get-previous-epoch
Open

apollo_staking: implement get_previous_epoch in CairoStakingContract#12902
dafnamatsry wants to merge 1 commit intodafna/mock-staking-get-previous-epoch-datafrom
dafna/apollo-staking-get-previous-epoch

Conversation

@dafnamatsry
Copy link
Collaborator

@dafnamatsry dafnamatsry commented Feb 26, 2026

Note

Medium Risk
Adds a new on-chain view call and custom retdata parsing for Option<Epoch>, which could affect epoch selection logic if the contract encoding/entrypoint differs or parsing is incorrect.

Overview
Implements CairoStakingContract::get_previous_epoch by calling the new get_previous_epoch_data entrypoint and deserializing the returned Cairo Option<Epoch>.

Adds optional_epoch_from_retdata to decode Some/None epoch responses with stricter length/variant validation, and extends tests to cover default None, successful updates, and error cases.

Written by Cursor Bugbot for commit fdb5152. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

dafnamatsry commented Feb 26, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@dafnamatsry dafnamatsry force-pushed the dafna/apollo-staking-get-previous-epoch branch from 2f7280c to fdb5152 Compare February 26, 2026 12:38
@dafnamatsry dafnamatsry force-pushed the dafna/mock-staking-get-previous-epoch-data branch from fabaf19 to e14599a Compare February 26, 2026 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants