Skip to content

Commit b2b7fec

Browse files
Add test for nil block balance
1 parent 2e9f44a commit b2b7fec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

storage/balance_storage_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ func TestBalance(t *testing.T) {
171171
storage := NewBalanceStorage(database)
172172
storage.Initialize(mockHelper, nil)
173173

174+
t.Run("Get balance at nil block", func(t *testing.T) {
175+
amount, err := storage.GetBalance(ctx, account, currency, nil)
176+
assert.True(t, errors.Is(err, ErrBlockNil))
177+
assert.Nil(t, amount)
178+
})
179+
174180
t.Run("Get unset balance", func(t *testing.T) {
175181
amount, err := storage.GetBalance(ctx, account, currency, newBlock)
176182
assert.NoError(t, err)

0 commit comments

Comments
 (0)