Skip to content

Commit 00ff781

Browse files
authored
feat: add GetPowerTableByInstance method to F3 (#1026)
* feat: add GetCertPowerTable method to F3 Adds a method to get the power table (committee) used to validate the specified instance. Signed-off-by: Jakub Sztandera <[email protected]> * rename Signed-off-by: Jakub Sztandera <[email protected]> --------- Signed-off-by: Jakub Sztandera <[email protected]>
1 parent bdbcb43 commit 00ff781

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

f3.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ func (m *F3) GetCert(ctx context.Context, instance uint64) (*certs.FinalityCerti
126126
return nil, ErrF3NotRunning
127127
}
128128

129+
// GetPowerTableByInstance returns the power table (committee) used to validate the specified instance.
130+
func (m *F3) GetPowerTableByInstance(ctx context.Context, instance uint64) (gpbft.PowerEntries, error) {
131+
if state := m.state.Load(); state != nil {
132+
return state.cs.GetPowerTable(ctx, instance)
133+
}
134+
return nil, ErrF3NotRunning
135+
}
136+
129137
// computeBootstrapDelay returns the time at which the F3 instance specified by
130138
// the passed manifest should be started.
131139
func (m *F3) computeBootstrapDelay() (time.Duration, error) {

0 commit comments

Comments
 (0)