Skip to content

Commit

Permalink
use math.pow to calculate count
Browse files Browse the repository at this point in the history
  • Loading branch information
leonz789 committed Jan 23, 2025
1 parent 9ee6746 commit 1b8667e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/oracle/keeper/feedermanagement/data_elaborate_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package feedermanagement

import (
"math"

oracletypes "github.com/ExocoreNetwork/exocore/x/oracle/types"
)

Expand Down Expand Up @@ -221,8 +223,7 @@ func generateAllBlocks(validatorSets []validatorSet, quotingWindow int, sizeVali
panic("only support for 4 validators for test case")
}
// count of possible combinations for one validatorSet
count := (2 ^ sizeValidators) ^ quotingWindow
// ret := make([]*blocks, 0, len(validatorSets)*count)
count := int(math.Pow(math.Pow(2, float64(sizeValidators)), float64(quotingWindow)))
ret := make([]*Blocks, 0, len(validatorSets)*count)
for _, vs := range validatorSets {
// TODO: this should be generated from seizeValidtors instead of hard code
Expand Down

0 comments on commit 1b8667e

Please sign in to comment.