Convert `readBranch` to Cadence.

See #375.