Skip to content

Fix for new outcomes and statuses#223

Open
RodriFS wants to merge 5 commits into
masterfrom
fix-new-outcomes-and-statuses
Open

Fix for new outcomes and statuses#223
RodriFS wants to merge 5 commits into
masterfrom
fix-new-outcomes-and-statuses

Conversation

@RodriFS
Copy link
Copy Markdown
Collaborator

@RodriFS RodriFS commented May 13, 2026

This PR fixes the daemon failing when it cannot save a status that it doesn't know to the database

Copilot AI review requested due to automatic review settings May 13, 2026 10:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the daemon to recognize and persist newly introduced backend swap statuses/outcomes by extending the RPC/proto enums, the daemon’s status handling, and the database enum types via migrations.

Changes:

  • Added two new swap statuses for “contract amount mismatch” across models, RPC mapping, and protobuf.
  • Added a new swap outcome (ERROR) to the models and a migration to extend the DB enum.
  • Updated swap-in/out monitors and tests to handle/cover the new statuses/outcome.

Reviewed changes

Copilot reviewed 9 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
daemon/rpc/handlers.go Maps new DB statuses to RPC enum values.
daemon/rpc/40swapd.pb.go Regenerated protobuf Go bindings with new Status enum values.
daemon/proto/40swapd.proto Extends Status enum with amount mismatch states.
daemon/database/models/status_enum.go Adds new status constants and updates swap_status enum creation SQL.
daemon/database/models/outcome_enum.go Adds OutcomeError constant.
daemon/database/migrations.go Adds migrations to extend Postgres enum types for outcome/status.
daemon/daemon/swap_out.go Handles/logs unexpected/new statuses for swap-out monitoring.
daemon/daemon/swap_out_test.go Cleans up unused test constants.
daemon/daemon/swap_in.go Adds handling for new mismatch statuses and ERROR outcome when done.
daemon/daemon/daemon_test.go Adds test cases for new statuses and ERROR outcome.
Files not reviewed (1)
  • daemon/rpc/40swapd.pb.go: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread daemon/database/models/status_enum.go Outdated
Comment thread daemon/database/models/outcome_enum.go
Comment thread daemon/database/migrations.go
Comment thread daemon/daemon/swap_out.go Outdated
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