Skip to content

Commit

Permalink
fix: racy test in IPNS
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Jun 22, 2023
1 parent 417c5f7 commit d127f7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ipns/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func TestValidate(t *testing.T) {
func TestValidateWithName(t *testing.T) {
t.Parallel()

sk, _, pid := mustKeyPair(t, ic.Ed25519)
sk, _, name := mustKeyPair(t, ic.Ed25519)
eol := time.Now().Add(time.Hour)

r, err := NewRecord(sk, testPath, 1, eol, 0)
Expand All @@ -231,15 +231,15 @@ func TestValidateWithName(t *testing.T) {
t.Run("valid peer ID", func(t *testing.T) {
t.Parallel()

err = ValidateWithName(r, pid)
err := ValidateWithName(r, name)
assert.NoError(t, err)
})

t.Run("invalid peer ID", func(t *testing.T) {
t.Parallel()

_, _, pid2 := mustKeyPair(t, ic.Ed25519)
err = ValidateWithName(r, pid2)
_, _, name2 := mustKeyPair(t, ic.Ed25519)
err := ValidateWithName(r, name2)
assert.ErrorIs(t, err, ErrSignature)
})
}

0 comments on commit d127f7e

Please sign in to comment.