Convert `mergeBranches` to Cadence.
Convert `drainRoot` to Cadence.