diff --git a/contracts/utils.go b/contracts/utils.go index 2f6f718bfd..39dfe7e917 100644 --- a/contracts/utils.go +++ b/contracts/utils.go @@ -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:]...) diff --git a/contracts/validator/validator_test.go b/contracts/validator/validator_test.go index 8543efd081..43665cfb37 100644 --- a/contracts/validator/validator_test.go +++ b/contracts/validator/validator_test.go @@ -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:]) diff --git a/core/blockchain.go b/core/blockchain.go index 0d0f64b57b..a1fbc24280 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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) diff --git a/core/vm/privacy/bulletproof.go b/core/vm/privacy/bulletproof.go index 2de8f4e1e3..addeab7326 100644 --- a/core/vm/privacy/bulletproof.go +++ b/core/vm/privacy/bulletproof.go @@ -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 }