Skip to content

Commit

Permalink
chore: add unbonds generator test
Browse files Browse the repository at this point in the history
  • Loading branch information
freak12techno committed Jun 22, 2024
1 parent 2da7e04 commit 9c3b1e6
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
File renamed without changes.
36 changes: 36 additions & 0 deletions pkg/generators/unbonds_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package generators

import (
"main/pkg/constants"
"main/pkg/fetchers"
statePkg "main/pkg/state"
"testing"

"github.com/stretchr/testify/assert"
)

func TestUnbondsGeneratorNoState(t *testing.T) {
t.Parallel()

state := statePkg.NewState()
generator := NewUnbondsGenerator()
results := generator.Generate(state)
assert.Empty(t, results)
}

func TestUnbondsGeneratorNotEmptyState(t *testing.T) {
t.Parallel()

state := statePkg.NewState()
state.Set(constants.FetcherNameUnbonds, fetchers.UnbondsData{
Unbonds: map[string]map[string]uint64{
"chain": {
"validator": 100,
},
},
})

generator := NewUnbondsGenerator()
results := generator.Generate(state)
assert.NotEmpty(t, results)
}

0 comments on commit 9c3b1e6

Please sign in to comment.