Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

feat: Use a clock interface in pstoreds as well #200

Merged
merged 2 commits into from
May 27, 2022
Merged

Conversation

MarcoPolo
Copy link
Contributor

Continues the work from #199 to do the same thing in pstoreds.

This also updates the tests. On my machine, tests finish in 5s compared to 46s before this change.

@github-actions
Copy link

Suggested version: v0.7.0
Comparing to: v0.6.0 (diff)

Changes in go.mod file(s):

diff --git a/go.mod b/go.mod
index da84215..8ebd97e 100644
--- a/go.mod
+++ b/go.mod
@@ -1,10 +1,11 @@
 module github.com/libp2p/go-libp2p-peerstore
 
-go 1.16
+go 1.17
 
 retract v0.2.9 // Contains backwards-incompatible changes. Use v0.3.0 instead.
 
 require (
+	github.com/benbjohnson/clock v1.3.0
 	github.com/gogo/protobuf v1.3.2
 	github.com/hashicorp/golang-lru v0.5.4
 	github.com/ipfs/go-datastore v0.5.0
@@ -18,5 +19,42 @@ require (
 	github.com/multiformats/go-multiaddr-fmt v0.1.0
 	github.com/stretchr/testify v1.7.0
 	go.uber.org/goleak v1.1.10
+)
+
+require (
+	github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 // indirect
+	github.com/btcsuite/btcd v0.20.1-beta // indirect
+	github.com/cespare/xxhash v1.1.0 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/dgraph-io/badger v1.6.2 // indirect
+	github.com/dgraph-io/ristretto v0.0.2 // indirect
+	github.com/dustin/go-humanize v1.0.0 // indirect
+	github.com/golang/protobuf v1.3.1 // indirect
+	github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db // indirect
+	github.com/google/uuid v1.1.1 // indirect
+	github.com/ipfs/go-cid v0.0.7 // indirect
+	github.com/jbenet/goprocess v0.1.4 // indirect
+	github.com/libp2p/go-openssl v0.0.7 // indirect
+	github.com/mattn/go-isatty v0.0.13 // indirect
+	github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect
+	github.com/minio/sha256-simd v0.1.1 // indirect
+	github.com/mr-tron/base58 v1.2.0 // indirect
+	github.com/multiformats/go-base36 v0.1.0 // indirect
+	github.com/multiformats/go-multibase v0.0.3 // indirect
+	github.com/multiformats/go-multihash v0.0.14 // indirect
+	github.com/multiformats/go-varint v0.0.6 // indirect
+	github.com/pkg/errors v0.8.1 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	github.com/spacemonkeygo/spacelog v0.0.0-20180420211403-2296661a0572 // indirect
+	github.com/spaolacci/murmur3 v1.1.0 // indirect
+	github.com/syndtr/goleveldb v1.0.0 // indirect
+	go.uber.org/atomic v1.7.0 // indirect
+	go.uber.org/multierr v1.6.0 // indirect
+	go.uber.org/zap v1.16.0 // indirect
+	golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
+	golang.org/x/lint v0.0.0-20190930215403-16217165b5de // indirect
+	golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect
+	golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect
 	golang.org/x/tools v0.1.1 // indirect
+	gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
 )

gorelease says:

# github.com/libp2p/go-libp2p-peerstore/addr
## incompatible changes
package removed

# github.com/libp2p/go-libp2p-peerstore/pstoreds
## compatible changes
Options.Clock: added

# github.com/libp2p/go-libp2p-peerstore/pstoremem
## compatible changes
AddrBookOption: added
WithClock: added

# github.com/libp2p/go-libp2p-peerstore/test
## incompatible changes
TestAddrBook: changed from func(*testing.T, AddrBookFactory) to func(*testing.T, AddrBookFactory, *github.com/benbjohnson/clock.Mock)

# summary
Suggested version: v0.7.0

gocompat says:

(empty)

@MarcoPolo MarcoPolo merged commit 9f3a96b into master May 27, 2022
@MarcoPolo MarcoPolo deleted the marco/with-clock-2 branch May 27, 2022 16:30
@MarcoPolo MarcoPolo mentioned this pull request Jul 7, 2022
41 tasks
@ajnavarro ajnavarro mentioned this pull request Aug 24, 2022
72 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants