core: rename (*Blockchain).GetValidators to ComputeNextBlockValidators

We have two similar blockchain APIs: GetNextBlockValidators and GetValidators.
It's hard to distinguish them, thus renaming it to match the meaning, so what
we have now is:

GetNextBlockValidators literally just returns the top of the committee that
was elected in the start of batch of CommitteeSize blocks batch. It doesn't
change its valie every block.

ComputeNextBlockValidators literally computes the list of validators based on
the most fresh committee members information got from the NeoToken's storage
and based on the latest register/unregister/vote events. The list returned by
this method may be updated every block.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2023-08-30 19:48:20 +03:00
parent 96449d803a
commit 07e1bc7cd7
4 changed files with 17 additions and 15 deletions

View file

@ -261,7 +261,7 @@ func TestChainWithVolatileNumOfValidators(t *testing.T) {
priv0 := testchain.PrivateKeyByID(0)
vals := bc.GetValidators()
vals := bc.ComputeNextBlockValidators()
script, err := smartcontract.CreateDefaultMultiSigRedeemScript(vals)
require.NoError(t, err)
curWit := transaction.Witness{
@ -279,7 +279,7 @@ func TestChainWithVolatileNumOfValidators(t *testing.T) {
}
// Mimic consensus.
if bc.config.ShouldUpdateCommitteeAt(uint32(i)) {
vals = bc.GetValidators()
vals = bc.ComputeNextBlockValidators()
} else {
vals, err = bc.GetNextBlockValidators()
}