Skip to content

Commit

Permalink
Add tests for IISS4 reward calculation without elected P-Reps
Browse files Browse the repository at this point in the history
  • Loading branch information
eunsoo-icon committed Jan 24, 2024
1 parent 1887305 commit f7e6eef
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions icon/iiss/calculator/iiss4_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,18 @@ func TestReward(t *testing.T) {
}
})

// no elected PReps
org := r.pi.electedPRepCount
r.pi.electedPRepCount = 0
err = r.processPrepReward()
assert.NoError(t, err)
for _, p := range r.pi.rank {
assert.Equal(t, 0, p.commission.Sign())
assert.Equal(t, 0, p.voterReward.Sign())
assert.Equal(t, 0, p.wage.Sign())
}
r.pi.electedPRepCount = org

// processPrepReward()
err = r.processPrepReward()
assert.NoError(t, err)
Expand Down

0 comments on commit f7e6eef

Please sign in to comment.