```
This removes boilerplate code in the subclasses which otherwise only
differ by the result type.
```
Completes backport 3/3 of core [[https://github.com/bitcoin/bitcoin/pull/17399 | PR17399]]:
https://github.com/bitcoin/bitcoin/pull/17399/commits/10efc0487c442bccb0e4a9ac29452af1592a3cf2
Depends on D8327.