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

Staging #50

Merged
merged 4 commits into from
May 3, 2024
Merged

Staging #50

merged 4 commits into from
May 3, 2024

Conversation

Bhargavamacha
Copy link
Contributor

@Bhargavamacha Bhargavamacha commented May 3, 2024

Summary by CodeRabbit

  • New Features

    • Added a new module for data handling in the policy engine.
    • Introduced a new error type for invalid program-derived addresses in asset transactions.
    • Implemented enhanced verification for policy and identity accounts during asset transfers.
    • Added a function to verify program-derived addresses in utility functions.
  • Bug Fixes

    • Updated dependency paths for better stability and future maintenance.
  • Documentation

    • Improved comments to clarify the purpose of the transfers field in tracking accounts.
  • Refactor

    • Updated account types to enhance security and flexibility in asset transfer operations.

ChrisHagedorn and others added 4 commits April 17, 2024 13:37
… updates (#41)

* make policy account resizable

* resiable idenitty accounts (#35)

* resiable idenitty accounts

* update tests, init more tests

* remove commented files

* update signer checks + hash policy account (#36)

* update signer checks to use only authority or delegate

* policy hash + patches (#38)

* generic security fixes

* use hash to identify policies (#39)

* use hash to identify policies

* use policy account in hash

* Merged resizable policies and dashboards

* Updated clients rwa-token-sdk for resizable policy

* Added program

* update anchor binary

* update idls

* Rename IDL types in client

* use camel case + fix eslint + fix tests partially + update anchor repo

* fix tests

* Added @bridgesplit/sdk update to example

* Updated to support new PolicyType

* Updated policy enum types

* Updated examples

* fix typedoc issues

* fix typedoc issues

* Update instructions

* Updated instructions

* Convention update

* Updated typedoc json

* Updated testing path

* Removed examples

* fix build yaml

* update package + add lint to actions

* update package naming across file

* rm untracked file

* Added conventions

* Updated client to be coral anchor.

* clear github cache

* Deleted old idls

* update file names

* fix tests

---------

Co-authored-by: Bhargava Sai Macha <[email protected]>
Copy link

coderabbitai bot commented May 3, 2024

Walkthrough

The updates span across several modules, focusing on dependency shifts to a new repository, enhancing error handling, and refining account verification processes. Notably, the asset_controller and policy_engine programs witness significant tweaks in account management and error structuring, ensuring robust operational integrity and smoother integration with updated dependencies.

Changes

Files Affected Summary of Changes
rwa-token-sdk/.../index.ts, asset_controller/src/error.rs, utils.rs Exported new modules and entities, added new error types and utility functions.
Cargo.toml (Multiple Programs) Updated dependencies to point to coral-xyz/anchor instead of abk-labs/anchor.
asset_controller/.../*.rs Enhanced account handling, added verification and policy enforcement updates.
policy_engine/src/state/engine.rs Added function to calculate program-derived addresses.

🐇✨
In the code forest, under the moon's gaze,
A rabbit hopped, through the syntax maze.
With each line refined, and each error caught,
A smoother path forward, is what it sought.
Celebrate the changes, with a cheer, "Hooray!"
For cleaner code, leads us on our way! 🌟
🐇✨


Recent Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 695f336 and cead307.
Files ignored due to path filters (1)
  • programs/Cargo.lock is excluded by !**/*.lock
Files selected for processing (10)
  • clients/rwa-token-sdk/src/policy-engine/index.ts (1 hunks)
  • programs/asset_controller/Cargo.toml (1 hunks)
  • programs/asset_controller/src/error.rs (1 hunks)
  • programs/asset_controller/src/instructions/execute.rs (2 hunks)
  • programs/asset_controller/src/state/track.rs (2 hunks)
  • programs/asset_controller/src/utils.rs (2 hunks)
  • programs/data_registry/Cargo.toml (1 hunks)
  • programs/identity_registry/Cargo.toml (1 hunks)
  • programs/policy_engine/Cargo.toml (1 hunks)
  • programs/policy_engine/src/state/engine.rs (2 hunks)
Files skipped from review due to trivial changes (5)
  • clients/rwa-token-sdk/src/policy-engine/index.ts
  • programs/asset_controller/src/error.rs
  • programs/data_registry/Cargo.toml
  • programs/identity_registry/Cargo.toml
  • programs/policy_engine/Cargo.toml
Additional comments not posted (5)
programs/asset_controller/Cargo.toml (1)

21-22: Updated dependencies to point to the new repository coral-xyz. Ensure compatibility with existing codebase.

programs/asset_controller/src/state/track.rs (1)

36-39: Added handling for max_timeframe being zero to prevent tracking any history. Good handling of edge cases.

programs/policy_engine/src/state/engine.rs (1)

20-23: Added function get_policy_engine_pda to calculate program-derived addresses. Ensures correct linking of assets to policies.

programs/asset_controller/src/utils.rs (1)

78-84: Added verify_pda function to validate PDAs against expected values. Enhances security by ensuring integrity of PDAs.

programs/asset_controller/src/instructions/execute.rs (1)

39-56: Changed several account types to UncheckedAccount for flexibility. Ensure thorough testing to prevent security vulnerabilities.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@luke-truitt luke-truitt merged commit 25d161f into main May 3, 2024
3 of 4 checks passed
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.

3 participants