relab / hotstuff

MIT License
166 stars 52 forks source link

modules/registry: fix ListModules with interface types #102

Closed johningve closed 11 months ago

johningve commented 11 months ago

This was broken since fc203fc9

The problem is that RegisterModule looks at the zero value of a module's type. However, this does not work for interface types. A workaround is to get the type of a pointer to the interface and then access its element type.

Fixes #101

codecov[bot] commented 11 months ago

Codecov Report

Merging #102 (cdf88c5) into master (2060514) will increase coverage by 1.03%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
+ Coverage   71.59%   72.62%   +1.03%     
==========================================
  Files          63       63              
  Lines        6305     6305              
==========================================
+ Hits         4514     4579      +65     
+ Misses       1476     1419      -57     
+ Partials      315      307       -8     
Flag Coverage Δ
unittests 72.62% <100.00%> (+1.03%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
modules/registry.go 80.35% <100.00%> (+23.21%) :arrow_up:

... and 9 files with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more