Skip to content

Commit

Permalink
fix: Increased the buffer size of errChan in GetBiggestStakerId (ra…
Browse files Browse the repository at this point in the history
…zor-network#1175)

* feat: GetBiggestStakeAndId() implementation in parallel

* refactor: added logs for biggest staker

* fix: updated buffer size of error channel

* refactor: fixed tests
  • Loading branch information
Yashk767 authored Dec 22, 2023
1 parent fc27092 commit 99de721
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/propose.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (*UtilsStruct) GetBiggestStakeAndId(client *ethclient.Client, address strin
biggestStakerId uint32
mu sync.Mutex
wg sync.WaitGroup
errChan = make(chan error, 1)
errChan = make(chan error, numberOfStakers)
)

log.Debug("Iterating over all the stakers...")
Expand Down
2 changes: 1 addition & 1 deletion cmd/propose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ func TestGetBiggestStakeAndId(t *testing.T) {
{
name: "Test 1: When GetBiggestStakeAndId function executes successfully",
args: args{
numOfStakers: 2,
numOfStakers: 1,
remainingTime: 10,
stake: big.NewInt(1).Mul(big.NewInt(5326), big.NewInt(1e18)),
},
Expand Down

0 comments on commit 99de721

Please sign in to comment.