mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-15 17:30:44 +00:00
parent
adfbabc847
commit
e9da4ca95b
4 changed files with 4 additions and 6 deletions
|
|
@ -253,7 +253,6 @@ func GenM2FromRandomize(randomizes []int64, lenSigners int64) ([]int64, error) {
|
||||||
blockValidator := NewSlice(int64(0), lenSigners, 1)
|
blockValidator := NewSlice(int64(0), lenSigners, 1)
|
||||||
randIndexs := make([]int64, lenSigners)
|
randIndexs := make([]int64, lenSigners)
|
||||||
total := int64(0)
|
total := int64(0)
|
||||||
var temp int64 = 0
|
|
||||||
for _, j := range randomizes {
|
for _, j := range randomizes {
|
||||||
total += j
|
total += j
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +263,7 @@ func GenM2FromRandomize(randomizes []int64, lenSigners int64) ([]int64, error) {
|
||||||
blockLength = 1
|
blockLength = 1
|
||||||
}
|
}
|
||||||
randomIndex := int64(rand.Intn(blockLength))
|
randomIndex := int64(rand.Intn(blockLength))
|
||||||
temp = blockValidator[randomIndex]
|
temp := blockValidator[randomIndex]
|
||||||
blockValidator[randomIndex] = blockValidator[i]
|
blockValidator[randomIndex] = blockValidator[i]
|
||||||
blockValidator[i] = temp
|
blockValidator[i] = temp
|
||||||
blockValidator = append(blockValidator[:i], blockValidator[i+1:]...)
|
blockValidator = append(blockValidator[:i], blockValidator[i+1:]...)
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,6 @@ func GetRewardBalancesRate(foudationWalletAddr common.Address, masterAddr common
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signerAddr common.Address) common.Address {
|
func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signerAddr common.Address) common.Address {
|
||||||
owner := signerAddr
|
|
||||||
opts := new(bind.CallOpts)
|
opts := new(bind.CallOpts)
|
||||||
owner, err := validator.GetCandidateOwner(opts, signerAddr)
|
owner, err := validator.GetCandidateOwner(opts, signerAddr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -254,6 +253,7 @@ func GetCandidatesOwnerBySigner(validator *contractValidator.XDCValidator, signe
|
||||||
|
|
||||||
return owner
|
return owner
|
||||||
}
|
}
|
||||||
|
|
||||||
func toyVoteTx(t *testing.T, nonce uint64, amount *big.Int, to, addr common.Address) *types.Transaction {
|
func toyVoteTx(t *testing.T, nonce uint64, amount *big.Int, to, addr common.Address) *types.Transaction {
|
||||||
vote := "6dd7d8ea" // VoteMethod = "0x6dd7d8ea"
|
vote := "6dd7d8ea" // VoteMethod = "0x6dd7d8ea"
|
||||||
action := fmt.Sprintf("%s%s%s", vote, "000000000000000000000000", addr.String()[3:])
|
action := fmt.Sprintf("%s%s%s", vote, "000000000000000000000000", addr.String()[3:])
|
||||||
|
|
|
||||||
|
|
@ -3078,8 +3078,8 @@ func (bc *BlockChain) processTradingAndLendingStates(isValidBlockNumber bool, bl
|
||||||
return tradingState, lendingState, fmt.Errorf("failed to ProcessLiquidationData. Err: %v", err)
|
return tradingState, lendingState, fmt.Errorf("failed to ProcessLiquidationData. Err: %v", err)
|
||||||
}
|
}
|
||||||
if tradingService.IsSDKNode() {
|
if tradingService.IsSDKNode() {
|
||||||
finalizedTx := lendingstate.FinalizedResult{}
|
finalizedTx, err := ExtractLendingFinalizedTradeTransactions(block.Transactions())
|
||||||
if finalizedTx, err = ExtractLendingFinalizedTradeTransactions(block.Transactions()); err != nil {
|
if err != nil {
|
||||||
return tradingState, lendingState, err
|
return tradingState, lendingState, err
|
||||||
}
|
}
|
||||||
bc.AddFinalizedTrades(finalizedTx.TxHash, finalizedTrades)
|
bc.AddFinalizedTrades(finalizedTx.TxHash, finalizedTrades)
|
||||||
|
|
|
||||||
|
|
@ -919,7 +919,6 @@ func (mrp *MultiRangeProof) Deserialize(proof []byte) error {
|
||||||
offset += 32
|
offset += 32
|
||||||
|
|
||||||
mrp.Cx = new(big.Int).SetBytes(proof[offset : offset+32])
|
mrp.Cx = new(big.Int).SetBytes(proof[offset : offset+32])
|
||||||
offset += 32
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue