Skip to content

Commit

Permalink
Add Delete test
Browse files Browse the repository at this point in the history
  • Loading branch information
agouin committed Nov 20, 2023
1 parent 47ebefa commit edb0723
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions signer/cosigner_nonce_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@ import (
"time"

cometlog "github.com/cometbft/cometbft/libs/log"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
)

func TestNonceCache(t *testing.T) {

Check warning on line 15 in signer/cosigner_nonce_cache_test.go

View workflow job for this annotation

GitHub Actions / lint

unused-parameter: parameter 't' seems to be unused, consider removing or renaming it as _ (revive)
nc := NonceCache{}
for i := 0; i < 10; i++ {
nc.Add(&CachedNonce{UUID: uuid.New(), Expiration: time.Now().Add(1 * time.Second)})
}

nc.Delete(nc.Size() - 1)
nc.Delete(0)
}

type mockPruner struct {
cnc *CosignerNonceCache
count int
Expand Down

0 comments on commit edb0723

Please sign in to comment.