Check if hardfork is strictly greater than target (alias for isAfter)
gt
>
import { CANCUN, LONDON } from 'tevm' // Operator-style (reads like > operator) if (CANCUN.gt(LONDON)) { // ... } // Equivalent semantic form if (CANCUN.isAfter(LONDON)) { // ... }
import { Hardfork, CANCUN } from 'tevm' const fork = Hardfork(config.hardfork) if (fork.gt(CANCUN)) { console.warn("Running unknown post-Cancun hardfork") }
import { Hardfork, PRAGUE } from 'tevm' function isExperimental(fork: BrandedHardfork): boolean { return fork.gt(PRAGUE) }
LONDON (11) < MERGE (14) < SHANGHAI (15) < CANCUN (16) < PRAGUE (17)
import { CANCUN } from 'tevm' CANCUN.gt(CANCUN) // false - not strictly greater
Was this page helpful?