types: fix price heart beat alert tests

This commit is contained in:
c9s 2023-11-30 17:09:07 +08:00
parent a82bc86455
commit c2c1eca4c9
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -2,6 +2,7 @@ package types
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
@ -9,7 +10,8 @@ import (
)
func TestPriceHeartBeat_Update(t *testing.T) {
hb := PriceHeartBeat{}
hb := NewPriceHeartBeat(time.Minute)
updated, err := hb.Update(PriceVolume{Price: fixedpoint.NewFromFloat(22.0), Volume: fixedpoint.NewFromFloat(100.0)})
assert.NoError(t, err)
assert.True(t, updated)