Skip to content

feat(starknet): add support for maintenance mode - #424

Merged
ptisserand merged 2 commits into
mainfrom
feature/dev-720-executor-maintenance-mode
Aug 28, 2024
Merged

ptisserand merged 2 commits into
mainfrom
feature/dev-720-executor-maintenance-mode

Conversation

@ptisserand

@ptisserand ptisserand commented Aug 22, 2024

Copy link
Copy Markdown
Contributor

Description

Add support for maintenance mode, when executor is disabled, the following functions will revert:

  • create_order
  • cancel_order
  • execute_order
  • fulfill_order

Here is the interface for maintenance mode:

#[starknet::interface]
trait IMaintenance<T> {
    fn is_enabled(self: @T) -> bool;
    fn enable(ref self: T, enable: bool);
}

IMaintenance::enable can only be invoked by admin

What type of PR is this? (check all applicable)

  • 🍕 Feature (feat:)
  • 🐛 Bug Fix (fix:)
  • 📝 Documentation Update (docs:)
  • 🎨 Style (style:)
  • 🧑‍💻 Code Refactor (refactor:)
  • 🔥 Performance Improvements (perf:)
  • ✅ Test (test:)
  • 🤖 Build (build:)
  • 🔁 CI (ci:)
  • 📦 Chore (chore:)
  • ⏩ Revert (revert:)
  • 🚀 Breaking Changes (BREAKING CHANGE:)

Related Tickets & Documents

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 Documentation
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

PR Title and Description Guidelines:

  • Ensure your PR title follows semantic versioning standards. This helps automate releases and changelogs.
  • Use types like feat:, fix:, chore:, BREAKING CHANGE: etc. in your PR title.
  • Your PR title will be used as a commit message when merging. Make sure it adheres to Conventional Commits standards.

Closing Issues

@vercel

vercel Bot commented Aug 22, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
ark-project-sdk-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 2:54pm

@changeset-bot

changeset-bot Bot commented Aug 22, 2024

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0567cfb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@linear

linear Bot commented Aug 22, 2024

Copy link
Copy Markdown

@ptisserand
ptisserand requested a review from kwiss August 22, 2024 14:54
Comment on lines +43 to +62
trait IMaintenance<T> {
fn is_enabled(self: @T) -> bool;
fn enable(ref self: T, enable: bool);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we use a more descriptive function name here ? like set_maintenance_mode

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated:

#[starknet::interface]
trait IMaintenance<T> {
    fn is_in_maintenance(self: @T) -> bool;
    fn set_maintenance_mode(ref self: T, on: bool);
}

@ptisserand
ptisserand force-pushed the feature/dev-720-executor-maintenance-mode branch from efca109 to 0567cfb Compare August 28, 2024 13:52
@ptisserand
ptisserand merged commit ff919d9 into main Aug 28, 2024
@ptisserand
ptisserand deleted the feature/dev-720-executor-maintenance-mode branch August 28, 2024 14:30
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