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

Allow P-chain wallet to be used by the platformvm #3314

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

This allows the p.Wallet to be imported by packages that are imported by the vms/platformvm package. This will be used to expose the full P-chain wallet in platformvm unit tests.

How this works

The only dependency the wallet has on vms/platformvm is for the client operations. These have been factored out into an interface that can be populated with either a rpc client or any custom client (which will be defined in the unit tests)

How this was tested

This is a pure refactor, existing CI covers the impacted files.

@StephenButtolph StephenButtolph self-assigned this Aug 20, 2024
@StephenButtolph StephenButtolph added this to the v1.11.11 milestone Aug 20, 2024
@StephenButtolph StephenButtolph added cleanup Code quality improvement acp103 labels Aug 20, 2024
}
}

type client struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if it is not simpler to just export these fields? The constructor doesn't do anything special so i think it might make sense to skip it altogether and just initialize the instance with its fields (exported) directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The wrapping function is nice to enforce that they are provided imo (as the struct is not useful without populating them).

If this signature looks weird I'd be down to unexport the Client type entirely to avoid invalid use.

@StephenButtolph StephenButtolph added this pull request to the merge queue Aug 20, 2024
Merged via the queue into master with commit bfe9fbb Aug 20, 2024
21 checks passed
@StephenButtolph StephenButtolph deleted the expose-wallet branch August 20, 2024 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acp103 cleanup Code quality improvement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants