all: fix ineffassign (#1516)

Co-authored-by: wit <wit765765346@gmail>
This commit is contained in:
wit liu 2025-09-17 08:49:28 +08:00 committed by GitHub
parent adfbabc847
commit e9da4ca95b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 4 additions and 6 deletions

View file

@ -253,7 +253,6 @@ func GenM2FromRandomize(randomizes []int64, lenSigners int64) ([]int64, error) {
blockValidator := NewSlice(int64(0), lenSigners, 1)
randIndexs := make([]int64, lenSigners)
total := int64(0)
var temp int64 = 0
for _, j := range randomizes {
total += j
}
@ -264,7 +263,7 @@ func GenM2FromRandomize(randomizes []int64, lenSigners int64) ([]int64, error) {
blockLength = 1
}
randomIndex := int64(rand.Intn(blockLength))
temp = blockValidator[randomIndex]
temp := blockValidator[randomIndex]
blockValidator[randomIndex] = blockValidator[i]
blockValidator[i] = temp
blockValidator = append(blockValidator[:i], blockValidator[i+1:]...)

View file

@ -244,7 +244,6 @@ func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common
}
func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signerAddr common.Address) common.Address {
owner := signerAddr
opts := new(bind.CallOpts)
owner, err := validator.GetCandidateOwner(opts, signerAddr)
if err != nil {
@ -254,6 +253,7 @@ func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signe
return owner
}
func toyVoteTx(t *testing.T, nonce uint64, amount *big.Int, to, addr common.Address) *types.Transaction {
vote := "6dd7d8ea" // VoteMethod = "0x6dd7d8ea"
action := fmt.Sprintf("%s%s%s", vote, "000000000000000000000000", addr.String()[3:])

View file

@ -3078,8 +3078,8 @@ func (bc *BlockChain) processTradingAndLendingStates(isValidBlockNumber bool, bl
return tradingState, lendingState, fmt.Errorf("failed to ProcessLiquidationData. Err: %v", err)
}
if tradingService.IsSDKNode() {
finalizedTx := lendingstate.FinalizedResult{}
if finalizedTx, err = ExtractLendingFinalizedTradeTransactions(block.Transactions()); err != nil {
finalizedTx, err := ExtractLendingFinalizedTradeTransactions(block.Transactions())
if err != nil {
return tradingState, lendingState, err
}
bc.AddFinalizedTrades(finalizedTx.TxHash, finalizedTrades)

View file

@ -919,7 +919,6 @@ func (mrp *MultiRangeProof) Deserialize(proof []byte) error {
offset += 32
mrp.Cx = new(big.Int).SetBytes(proof[offset : offset+32])
offset += 32
return nil
}