Assigning explicit error type (e.g., `*ierrors.NotLeaderError`) to an interface variable (e.g. `var err error`) will result in `nil` check to return `false` even if we assign a `nil` to it. See https://go.dev/doc/faq#nil_error and https://go.dev/play/p/8HUKlSDPvCT The following needs to change in `bcdb/db.go`: ## DB ```go type DB interface { IsLeader() *ierrors.NotLeaderError } ``` should be ```go type DB interface { IsLeader() error } ``` ## TxProcessor ```go type TxProcessor interface { IsLeader() *ierrors.NotLeaderError } ``` should be ```go type TxProcessor interface { IsLeader() error } ```
Assigning explicit error type (e.g.,
*ierrors.NotLeaderError) to an interface variable (e.g.var err error) will result innilcheck to returnfalseeven if we assign anilto it.See https://go.dev/doc/faq#nil_error and https://go.dev/play/p/8HUKlSDPvCT
The following needs to change in
bcdb/db.go:DB
should be
TxProcessor
should be