Feature/on chain permissions#687
Draft
mattdean-digicatapult wants to merge 2 commits into
Draft
Conversation
13 tasks
There was a problem hiding this comment.
Pull Request Overview
This PR implements on-chain permissions functionality by adding a permission system that controls access to demand creation and match proposal operations. The changes introduce permission tokens that are checked before users can perform certain blockchain operations.
- Adds a new
Permissiontoken type and related database schema to track user permissions for different scopes (member_a, member_b, optimiser) - Updates demand creation and match proposal processes to require valid on-chain permissions
- Modifies the payload structure to use references instead of consuming tokens directly in certain operations
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/seeds/offchainSeeds/*.ts | Add permission seeding to test data for comprehensive test coverage |
| test/integration/*/**.test.ts | Add permission setup and test permission validation in integration tests |
| test/helper/chainTest.ts | Add helper function to create all required permissions for testing |
| src/lib/payload.ts | Update payload structures to include permission references and version bumps |
| src/lib/indexer/*.ts | Add permission processing, database operations, and event handling |
| src/lib/db/*.ts | Add permission table schema, types, and migration |
| src/controllers/v1/*.ts | Add permission validation before on-chain operations |
| l3.sqnc | Update token specification to include Permission token and updated process versions |
Comments suppressed due to low confidence (2)
docker-compose.yml:1
- [nitpick] The YAML array formatting change from
['CMD-SHELL', 'pg_isready -U postgres']to[ 'CMD-SHELL', 'pg_isready -U postgres' ]is inconsistent with line 14 which still uses the compact format. All healthcheck test arrays should use consistent formatting.
services:
docker-compose.yml:1
- [nitpick] The YAML array formatting change from
['CMD-SHELL', 'pg_isready -U postgres']to[ 'CMD-SHELL', 'pg_isready -U postgres' ]is inconsistent with line 14 which still uses the compact format. All healthcheck test arrays should use consistent formatting.
services:
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| const node = container.resolve(ChainNode) | ||
|
|
||
| const context: { app: Express; indexer: Indexer } = {} as { app: Express; indexer: Indexer } | ||
| const context: { app: Express; indexer: Indexer } = {} as typeof context |
There was a problem hiding this comment.
Using typeof context creates a circular type reference. The original type annotation was clearer and should be restored: {} as { app: Express; indexer: Indexer }
Suggested change
| const context: { app: Express; indexer: Indexer } = {} as typeof context | |
| const context: { app: Express; indexer: Indexer } = {} as { app: Express; indexer: Indexer } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Checklist
PR Type
Please delete options that are irrelevant.
Linked tickets
High level description
Detailed description
Describe alternatives you've considered
Operational impact
Additional context