isCompatible method

bool isCompatible(
  1. BridgeProtocolVersion other
)

Check if other is compatible with this version.

Compatibility rules:

  • Major versions must match (breaking changes).
  • Minor of other must be <= this minor (backward-compatible features).
  • Patch is always compatible.

Implementation

bool isCompatible(BridgeProtocolVersion other) {
  if (major != other.major) return false;
  if (other.minor > minor) return false;
  return true;
}