Repository navigation
refactor: deduplicate adapter boilerplate - #541
collinsezedike merged 6 commits into
Conversation
|
@Adecom16 is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
collinsezedike
left a comment
There was a problem hiding this comment.
@Adecom16 looking at the pushed changes, this PR appears incomplete: it only adds packages/contracts/adapter-common/src/lib.rs, nothing else is touched. Cargo.toml's workspace members isn't updated to include it, and blend-adapter/defindex-adapter still have their own duplicated VAULT_KEY/USDC_KEY/AlreadyInitialized/initialize code rather than using it, even though the PR description says both were updated to use the shared scaffolding. Is this still in progress and you're buffering commits, or was opening this PR an accident?
| @@ -0,0 +1,77 @@ | |||
| #![no_std] | |||
There was a problem hiding this comment.
This crate has no Cargo.toml, so it isn't a valid crate, cargo build/cargo test silently ignores this directory entirely.
| [workspace] | ||
| resolver = "2" | ||
| members = ["vault", "blend-adapter", "defindex-adapter"] | ||
| members = ["vault", "router", "blend-adapter", "defindex-adapter", "adapter-common"] |
collinsezedike
left a comment
There was a problem hiding this comment.
@Adecom16 thank you for addressing the Cargo.toml issue and actually wiring the shared crate in, this genuinely eliminates the duplication #460 was about. One small thing for a future pass: get_vault in adapter-common isn't called anywhere, not blocking this PR.
If you're looking for another issue to pick up, feel free to grab one of the open ones.
Merging now.
Summary
Closes #460
Refactors the shared boilerplate between
blend-adapteranddefindex-adapterinto a reusable shared module while keeping protocol-specific yield logic in each adapter.Changes
initialize()logic.blend-adapterto use the shared scaffolding.defindex-adapterto use the shared scaffolding.Compatibility
accrue()and yield-source logic remains in each adapter.Validation
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo testAll relevant contract tests pass.