Skip to content

Commit a041897

Browse files
authored
Merge pull request #158 from ipfs/fix/flatfs-fuzz-provider
Add the generated flatfs stub, since it cannot be auto-generated
2 parents 874de58 + f3aa2fa commit a041897

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

fuzz/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ replace github.com/ipfs/go-datastore => ../
66

77
require (
88
github.com/ipfs/go-datastore v0.4.4
9+
github.com/ipfs/go-ds-flatfs v0.4.4
910
github.com/spf13/pflag v1.0.3
1011
)

fuzz/go.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkBy
22
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
33
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
44
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
5+
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 h1:iW0a5ljuFxkLGPNem5Ui+KBjFJzKg4Fv2fnxe4dvzpM=
56
github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5/go.mod h1:Y2QMoi1vgtOIfc+6DhrMOGkLoGzqSV2rKp4Sm+opsyA=
67
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
78
github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko=

fuzz/provider_go-ds-flatfs.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package fuzzer
2+
3+
import (
4+
ds "github.com/ipfs/go-datastore"
5+
prov "github.com/ipfs/go-ds-flatfs"
6+
)
7+
8+
func init() {
9+
AddOpener("go-ds-flatfs", func(loc string) ds.Datastore {
10+
d, err := prov.CreateOrOpen(loc, prov.IPFS_DEF_SHARD, false)
11+
if err != nil {
12+
panic("could not create db instance")
13+
}
14+
return d
15+
})
16+
}

0 commit comments

Comments
 (0)