Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/pausable #257

Merged
merged 2 commits into from
Jan 29, 2025
Merged

Feat/pausable #257

merged 2 commits into from
Jan 29, 2025

Conversation

gluax
Copy link
Collaborator

@gluax gluax commented Jan 27, 2025

Motivation

Pausable behavior adds safety in case something goes wrong.

Explanation of Changes

Adds pause and unpause exec methods, checking if you are owner first.
These methods just always pause/unpause rather than erroring if they are already in that state. Let me know if this should be changed.

Querying dr's by status returns an empty list when contract is paused.
Sudo methods do not work while the contract is paused.

We also have a query to check the paused state of the contract.
Was unsure if this should pause the other DR queries/executions?

I didn't update the version in the toml yet, because was unsure if this dictates a minor or patch change :x

Testing

New tests added.

Related PRs and Issues

Waiting for sedaprotocol/seda-common-rs#39 to be merged first.

Closes #256.

@gluax gluax self-assigned this Jan 27, 2025
contract/src/contract.rs Show resolved Hide resolved
contract/src/msgs/owner/execute/pause.rs Outdated Show resolved Hide resolved
@gluax
Copy link
Collaborator Author

gluax commented Jan 28, 2025

I'll wait for input on the above comments, and on the common side(in case we also need to make changes there), before making any changes.

Cargo.toml Outdated Show resolved Hide resolved
Copy link

Code Coverage

Package Line Rate Complexity Health
contract.src.msgs.staking.execute 97% 0
contract.src.msgs 93% 0
contract.src.msgs.data_requests 97% 0
contract.src.msgs.data_requests.execute 100% 0
contract.src.msgs.owner.execute 96% 0
contract.src.msgs.owner 100% 0
contract.src.msgs.staking.state 96% 0
contract.src.msgs.staking 95% 0
contract.src 86% 0
contract.src.msgs.data_requests.sudo 92% 0
contract.src.msgs.data_requests.state 98% 0
Summary 96% (3775 / 3924) 0

@Thomasvdam Thomasvdam merged commit 3d1258d into main Jan 29, 2025
2 checks passed
@Thomasvdam Thomasvdam deleted the feat/pausable branch January 29, 2025 11:24
@gluax
Copy link
Collaborator Author

gluax commented Jan 29, 2025

We didn't update the version in the cargo toml :p

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.

✨ Add pause/unpause functionality
3 participants