Skip to content

feat: validate lighter order value#142

Open
mpetrun5 wants to merge 2 commits intomainfrom
feat/check-chain-confirmation-on-lighter
Open

feat: validate lighter order value#142
mpetrun5 wants to merge 2 commits intomainfrom
feat/check-chain-confirmation-on-lighter

Conversation

@mpetrun5
Copy link
Collaborator

Description

Related Issue Or Context

Closes: #141

How Has This Been Tested? Testing details.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Checklist:

  • I have commented my code, particularly in hard-to-understand areas.
  • I have ensured that all acceptance criteria (or expected behavior) from issue are met
  • I have updated the documentation locally and in docs.
  • I have added tests to cover my changes.
  • I have ensured that all the checks are passing and green, I've signed the CLA bot

Copy link

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 adds validation for Lighter order values against configured confirmation buckets to ensure orders are within acceptable limits. The implementation follows the same pattern used in EVM chains for order value validation.

Changes:

  • Added configuration for USD value buckets and their corresponding confirmation requirements
  • Implemented order size validation in the Lighter message handler
  • Added test coverage for invalid order values that exceed bucket limits

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
chains/lighter/config.go Adds ConfirmationsByValue map to LighterConfig and populates it from solver configuration
chains/lighter/config_test.go Adds test case validating confirmation bucket configuration
chains/lighter/message/lighter.go Adds verifyOrderSize function and integrates it into withdrawal verification flow
chains/lighter/message/lighter_test.go Adds test for invalid order value validation and fixes test setup to include confirmations; corrects InvalidAsset test to use proper transaction type
app/app.go Passes ConfirmationsByValue from config to LighterMessageHandler constructor

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

@github-actions
Copy link

Go Test coverage is 53.7 %\ ✨ ✨ ✨

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 confirmation check to lighter

2 participants