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

Restrict orders to enabled networks #424

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

sundayonah
Copy link
Collaborator

Description

This PR ensures that payments can only be initiated for networks that are actively supported by introducing an is_enabled field to the network table. This change prevents payments on disabled networks and restricts the system to only fetch and use enabled networks.

Key Changes:

  • Added is_enabled field to the network table with a default value of false.
  • Updated the Network entity schema to include is_enabled.
  • Modified setRPCClients to fetch and use only enabled networks.
  • Implemented validation in POST /sender/orders to prevent payments on disabled networks.
  • Ensured new networks default to is_enabled = false if not explicitly set.

References

closes #422

Testing

  • Test that payments are blocked for disabled networks.
  • Test that setRPCClients only fetches and connects to enabled networks.
  • Test that the is_enabled field defaults to false for new networks.

Checklist

  • I have added documentation and tests for new/changed functionality in this PR
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not main

@sundayonah sundayonah marked this pull request as draft February 11, 2025 04:19
@chibie chibie changed the title Restrict-orders-to-enabled-networks Restrict orders to enabled networks Feb 11, 2025
@sundayonah sundayonah force-pushed the restrict-orders-to-enabled-networks branch from 02a45ce to b9cc502 Compare February 12, 2025 15:43
@sundayonah sundayonah force-pushed the restrict-orders-to-enabled-networks branch from b9cc502 to 9e929e3 Compare February 12, 2025 16:03
@sundayonah sundayonah marked this pull request as ready for review February 12, 2025 19:08
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 is_enabled field to Networks and Restrict Orders to Enabled Networks
1 participant