You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: replace ! assertions in factories with LazyProviderMap.getOrThrow
The factory closures all used providerMap.get(chainId)! to coerce the
optional return into a non-null provider. That's safe today because every
validator map's isSupported predicate is a subset of LazyProviderMap's
supported set, but it's a brittle invariant — narrowing the supported set
in a future change would silently produce undefined providers wrapped
inside validator instances.
Add LazyProviderMap.getOrThrow(chainId): StaticJsonRpcProvider that throws
a clear error if the chainId isn't supported, and use it from the four
factory closures. The structural ProviderMap interface (Map-compatible
.get returning T | undefined) is unchanged.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments