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

Remove anchor wallet local implementation #59

Merged
merged 7 commits into from
Jun 13, 2024

Conversation

ChrisHagedorn
Copy link
Member

@ChrisHagedorn ChrisHagedorn commented Jun 7, 2024

There was an outdated type interface in Anchor, which required us to copy the Anchor wallet instance. However, Anchor has been updated to work now and functions directly off the dependency.

Summary by CodeRabbit

  • Documentation

    • Updated method call in README.md for consistency (setUpNewRegistry to setupNewRegistry).
  • Refactor

    • Reorganized and formatted code in the Client.ts file to improve readability and maintainability.

Bhargavamacha and others added 5 commits April 19, 2024 16:36
* Added SDK integration, flexible policy accounts, and general security 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]>

* Fixed documentation (#44)

---------

Co-authored-by: Chris Hagedorn <[email protected]>
minor security fixes and test updates (#55)
@Bhargavamacha Bhargavamacha changed the base branch from main to staging June 7, 2024 13:13
Copy link

cloudflare-workers-and-pages bot commented Jun 7, 2024

Deploying medici-typedoc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 99d487f
Status: ✅  Deploy successful!
Preview URL: https://e5b4a22b.medici-typedoc.pages.dev
Branch Preview URL: https://hotfix-rmv-anchor-wallet-cop.medici-typedoc.pages.dev

View logs

Copy link

coderabbitai bot commented Jun 7, 2024

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent changes involve renaming a method in the assetController class from setUpNewRegistry to setupNewRegistry, and restructuring the Client.ts file in the clients/rwa-token-sdk/src/classes directory. This includes consolidating imports and refining the RwaClient constructor for improved readability and maintainability.

Changes

File/Path Change Summary
clients/README.md Renamed method call from setUpNewRegistry to setupNewRegistry
clients/rwa-token-sdk/src/classes/... Consolidated imports and reformatted the RwaClient constructor

Poem

In code's vast field, a change so neat,
Methods renamed, structure replete.
Imports aligned in perfect array,
The client stands strong, ready to sway.
With tweaks so fine, our journey's bright,
CodeRabbit hops in pure delight. 🌟🐇


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ca8b26a and a532241.

Files selected for processing (2)
  • clients/README.md (1 hunks)
  • clients/rwa-token-sdk/src/classes/Client.ts (1 hunks)
Additional context used
GitHub Check: run-tests
clients/rwa-token-sdk/src/classes/Client.ts

[failure] 12-12:
Expected indentation of 1 tab but found 2 spaces


[failure] 15-15:
Expected indentation of 1 tab but found 2 spaces


[failure] 16-16:
Expected indentation of 1 tab but found 2 spaces


[failure] 17-17:
Expected indentation of 1 tab but found 2 spaces


[failure] 18-18:
Expected indentation of 1 tab but found 2 spaces


[failure] 19-19:
Expected indentation of 1 tab but found 2 spaces


[failure] 20-20:
Expected indentation of 1 tab but found 2 spaces


[failure] 22-22:
Expected indentation of 1 tab but found 2 spaces


[failure] 27-27:
Expected indentation of 1 tab but found 2 spaces


[failure] 28-28:
Expected indentation of 2 tabs but found 4 spaces

Markdownlint
clients/README.md

49-49: Column: 1 (MD010, no-hard-tabs)
Hard tabs


50-50: Column: 1 (MD010, no-hard-tabs)
Hard tabs


52-52: Column: 1 (MD010, no-hard-tabs)
Hard tabs


114-114: Column: 1 (MD010, no-hard-tabs)
Hard tabs


116-116: Column: 1 (MD010, no-hard-tabs)
Hard tabs


117-117: Column: 1 (MD010, no-hard-tabs)
Hard tabs


118-118: Column: 1 (MD010, no-hard-tabs)
Hard tabs


120-120: Column: 1 (MD010, no-hard-tabs)
Hard tabs


121-121: Column: 1 (MD010, no-hard-tabs)
Hard tabs


122-122: Column: 1 (MD010, no-hard-tabs)
Hard tabs


123-123: Column: 1 (MD010, no-hard-tabs)
Hard tabs


125-125: Column: 1 (MD010, no-hard-tabs)
Hard tabs


126-126: Column: 1 (MD010, no-hard-tabs)
Hard tabs


127-127: Column: 1 (MD010, no-hard-tabs)
Hard tabs


128-128: Column: 1 (MD010, no-hard-tabs)
Hard tabs


130-130: Column: 1 (MD010, no-hard-tabs)
Hard tabs

Additional comments not posted (2)
clients/rwa-token-sdk/src/classes/Client.ts (1)

6-6: The updated import statement correctly includes Wallet as needed for the constructor changes.

clients/README.md (1)

55-55: The method name setupNewRegistry is correctly updated in the documentation to match the actual method name in the code.

Please replace hard tabs with spaces to adhere to the Markdown style guide.

- const setupIx = await rwaClient.assetController.setupNewRegistry(
+ const setupIx = await rwaClient.assetController.setupNewRegistry(

Likely invalid or redundant comment.

Comment on lines 27 to 38
constructor(config: Config, wallet: Wallet) {
this.config = config;
this.provider = new AnchorProvider(
config.connection,
wallet,
config.confirmationOptions
);
this.assetController = new AssetController(this);
this.dataRegistry = new DataRegistry(this);
this.identityRegistry = new IdentityRegistry(this);
this.policyEngine = new PolicyEngine(this);
}
Copy link

Choose a reason for hiding this comment

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

The constructor now correctly accepts a Wallet parameter, aligning with the updated Anchor dependency management. However, please correct the indentation to match the project's style guide.

-  constructor(config: Config, wallet: Wallet) {
-    this.config = config;
-    this.provider = new AnchorProvider(
-      config.connection,
-      wallet,
-      config.confirmationOptions
-    );
-    this.assetController = new AssetController(this);
-    this.dataRegistry = new DataRegistry(this);
-    this.identityRegistry = new IdentityRegistry(this);
-    this.policyEngine = new PolicyEngine(this);
-  }
+	constructor(config: Config, wallet: Wallet) {
+		this.config = config;
+		this.provider = new AnchorProvider(
+			config.connection,
+			wallet,
+			config.confirmationOptions
+		);
+		this.assetController = new AssetController(this);
+		this.dataRegistry = new DataRegistry(this);
+		this.identityRegistry = new IdentityRegistry(this);
+		this.policyEngine = new PolicyEngine(this);
+	}
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
constructor(config: Config, wallet: Wallet) {
this.config = config;
this.provider = new AnchorProvider(
config.connection,
wallet,
config.confirmationOptions
);
this.assetController = new AssetController(this);
this.dataRegistry = new DataRegistry(this);
this.identityRegistry = new IdentityRegistry(this);
this.policyEngine = new PolicyEngine(this);
}
constructor(config: Config, wallet: Wallet) {
this.config = config;
this.provider = new AnchorProvider(
config.connection,
wallet,
config.confirmationOptions
);
this.assetController = new AssetController(this);
this.dataRegistry = new DataRegistry(this);
this.identityRegistry = new IdentityRegistry(this);
this.policyEngine = new PolicyEngine(this);
}
Tools
GitHub Check: run-tests

[failure] 27-27:
Expected indentation of 1 tab but found 2 spaces


[failure] 28-28:
Expected indentation of 2 tabs but found 4 spaces

@luke-truitt luke-truitt merged commit 97e2b04 into staging Jun 13, 2024
3 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