Skip to content

Feat/gsteenkamp/managed disputer#259

Merged
gsteenkamp89 merged 5 commits intomasterfrom
feat/gsteenkamp/managed-disputer
Feb 17, 2026
Merged

Feat/gsteenkamp/managed disputer#259
gsteenkamp89 merged 5 commits intomasterfrom
feat/gsteenkamp/managed-disputer

Conversation

@gsteenkamp89
Copy link
Collaborator

closes FE-388

Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
@linear
Copy link

linear bot commented Feb 17, 2026

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
amoy-optimistic-oracle-dapp-v2 Ready Ready Preview, Comment Feb 17, 2026 1:02pm
optimistic-oracle-dapp-v2 Ready Ready Preview, Comment Feb 17, 2026 1:02pm
optimistic-oracle-dapp-v2 (mirror-managed-oo) Ready Ready Preview, Comment Feb 17, 2026 1:02pm
sepolia-optimistic-oracle-dapp-v2 Ready Ready Preview, Comment Feb 17, 2026 1:02pm

Request Review

@0xjorgen
Copy link
Collaborator

Nit/suggestion (not a blocker for this PR): The raw string "Managed Optimistic Oracle V2" is now compared in many places across the codebase — this PR adds a few more. A typo in any one of them would silently break.

Would it be worth converting oracleTypes from an array to an as const object? This is already the pattern used by chainsById in the same file:

// shared/constants/oracle.ts
export const oracleTypes = {
  OOV1: "Optimistic Oracle V1",
  OOV2: "Optimistic Oracle V2",
  OOV3: "Optimistic Oracle V3",
  SkinnyOO: "Skinny Optimistic Oracle",
  SkinnyOOV2: "Skinny Optimistic Oracle V2",
  ManagedOOV2: "Managed Optimistic Oracle V2",
} as const;

Then comparisons become oracleType === oracleTypes.ManagedOOV2 — autocomplete-friendly and typo-proof.

Bonus: isValidOracleType in util.ts currently does oracleType in oracleTypes, but in on an array checks indices, not values — so it's likely broken today. Switching to an object would fix that for free.

Not necessarily for this PR, but could be a nice follow-up.

@gsteenkamp89
Copy link
Collaborator Author

Nit/suggestion (not a blocker for this PR): The raw string "Managed Optimistic Oracle V2" is now compared in many places across the codebase — this PR adds a few more. A typo in any one of them would silently break.

Would it be worth converting oracleTypes from an array to an as const object? This is already the pattern used by chainsById in the same file:

// shared/constants/oracle.ts
export const oracleTypes = {
  OOV1: "Optimistic Oracle V1",
  OOV2: "Optimistic Oracle V2",
  OOV3: "Optimistic Oracle V3",
  SkinnyOO: "Skinny Optimistic Oracle",
  SkinnyOOV2: "Skinny Optimistic Oracle V2",
  ManagedOOV2: "Managed Optimistic Oracle V2",
} as const;

Then comparisons become oracleType === oracleTypes.ManagedOOV2 — autocomplete-friendly and typo-proof.

Bonus: isValidOracleType in util.ts currently does oracleType in oracleTypes, but in on an array checks indices, not values — so it's likely broken today. Switching to an object would fix that for free.

Not necessarily for this PR, but could be a nice follow-up.

The current oracleTypes is already a readonly tuple and TSC will throw if I make a spelling error. I also get nice intellisense already.

But your 2nd point is definitely a bug. I think, so reduce the diff, I will keep the constant as-is, but just use the correct .includes() check inside isValidOracleType

Signed-off-by: Gerhard Steenkamp <gerhard@umaproject.org>
@gsteenkamp89 gsteenkamp89 merged commit bfcf9d3 into master Feb 17, 2026
5 checks passed
@gsteenkamp89 gsteenkamp89 deleted the feat/gsteenkamp/managed-disputer branch February 17, 2026 13:34
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.

2 participants