-
Notifications
You must be signed in to change notification settings - Fork 91
Labels
Technical DebtIssue which resolves technical debtIssue which resolves technical debtinternalFor changes that affect the project's internal workings but not its outward-facing functionality.For changes that affect the project's internal workings but not its outward-facing functionality.
Milestone
Description
Problem
Storage selection logic lives in Relay:
const storage = this.redisClient
? new RedisPendingTransactionStorage(this.redisClient)
: new LocalPendingTransactionStorage();Relay shouldn't know about storage implementation details.
Solution
Add factory method:
export class PendingTransactionStorageFactory {
static create(redisClient?: RedisClientType): PendingTransactionStorage {
return redisClient
? new RedisPendingTransactionStorage(redisClient)
: new LocalPendingTransactionStorage();
}
}
// In Relay
const storage = PendingTransactionStorageFactory.create(this.redisClient);Benefits
- Encapsulates storage selection logic where it belongs
- Relay stays focused on orchestration
- Easier to add new storage types
Acceptance Criteria
- Factory method created
- Relay uses factory
- Tests passing
Metadata
Metadata
Assignees
Labels
Technical DebtIssue which resolves technical debtIssue which resolves technical debtinternalFor changes that affect the project's internal workings but not its outward-facing functionality.For changes that affect the project's internal workings but not its outward-facing functionality.