forked from TrueCloudLab/frostfs-node
[#1437] ir: Fix contextcheck linters
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
16598553d9
commit
6921a89061
27 changed files with 165 additions and 157 deletions
|
@ -19,39 +19,39 @@ const (
|
|||
alphabetUpdateIDPrefix = "AlphabetUpdate"
|
||||
)
|
||||
|
||||
func (gp *Processor) processAlphabetSync(txHash util.Uint256) bool {
|
||||
func (gp *Processor) processAlphabetSync(ctx context.Context, txHash util.Uint256) bool {
|
||||
if !gp.alphabetState.IsAlphabet() {
|
||||
gp.log.Info(context.Background(), logs.GovernanceNonAlphabetModeIgnoreAlphabetSync)
|
||||
gp.log.Info(ctx, logs.GovernanceNonAlphabetModeIgnoreAlphabetSync)
|
||||
return true
|
||||
}
|
||||
|
||||
mainnetAlphabet, err := gp.mainnetClient.NeoFSAlphabetList()
|
||||
if err != nil {
|
||||
gp.log.Error(context.Background(), logs.GovernanceCantFetchAlphabetListFromMainNet,
|
||||
gp.log.Error(ctx, logs.GovernanceCantFetchAlphabetListFromMainNet,
|
||||
zap.String("error", err.Error()))
|
||||
return false
|
||||
}
|
||||
|
||||
sidechainAlphabet, err := gp.morphClient.Committee()
|
||||
if err != nil {
|
||||
gp.log.Error(context.Background(), logs.GovernanceCantFetchAlphabetListFromSideChain,
|
||||
gp.log.Error(ctx, logs.GovernanceCantFetchAlphabetListFromSideChain,
|
||||
zap.String("error", err.Error()))
|
||||
return false
|
||||
}
|
||||
|
||||
newAlphabet, err := newAlphabetList(sidechainAlphabet, mainnetAlphabet)
|
||||
if err != nil {
|
||||
gp.log.Error(context.Background(), logs.GovernanceCantMergeAlphabetListsFromMainNetAndSideChain,
|
||||
gp.log.Error(ctx, logs.GovernanceCantMergeAlphabetListsFromMainNetAndSideChain,
|
||||
zap.String("error", err.Error()))
|
||||
return false
|
||||
}
|
||||
|
||||
if newAlphabet == nil {
|
||||
gp.log.Info(context.Background(), logs.GovernanceNoGovernanceUpdateAlphabetListHasNotBeenChanged)
|
||||
gp.log.Info(ctx, logs.GovernanceNoGovernanceUpdateAlphabetListHasNotBeenChanged)
|
||||
return true
|
||||
}
|
||||
|
||||
gp.log.Info(context.Background(), logs.GovernanceAlphabetListHasBeenChangedStartingUpdate,
|
||||
gp.log.Info(ctx, logs.GovernanceAlphabetListHasBeenChangedStartingUpdate,
|
||||
zap.String("side_chain_alphabet", prettyKeys(sidechainAlphabet)),
|
||||
zap.String("new_alphabet", prettyKeys(newAlphabet)),
|
||||
)
|
||||
|
@ -62,9 +62,9 @@ func (gp *Processor) processAlphabetSync(txHash util.Uint256) bool {
|
|||
}
|
||||
|
||||
// 1. Vote to sidechain committee via alphabet contracts.
|
||||
err = gp.voter.VoteForSidechainValidator(votePrm)
|
||||
err = gp.voter.VoteForSidechainValidator(ctx, votePrm)
|
||||
if err != nil {
|
||||
gp.log.Error(context.Background(), logs.GovernanceCantVoteForSideChainCommittee,
|
||||
gp.log.Error(ctx, logs.GovernanceCantVoteForSideChainCommittee,
|
||||
zap.String("error", err.Error()))
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,7 @@ func (gp *Processor) processAlphabetSync(txHash util.Uint256) bool {
|
|||
// 4. Update FrostFS contract in the mainnet.
|
||||
gp.updateFrostFSContractInMainnet(newAlphabet)
|
||||
|
||||
gp.log.Info(context.Background(), logs.GovernanceFinishedAlphabetListUpdate)
|
||||
gp.log.Info(ctx, logs.GovernanceFinishedAlphabetListUpdate)
|
||||
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue