From f3aa2fa174603932078852d450aac1404f982668 Mon Sep 17 00:00:00 2001 From: Will Scott Date: Wed, 29 Apr 2020 20:17:59 -0700 Subject: [PATCH] Add the generated flatfs stub, since it cannot be auto-generated --- fuzz/go.mod | 1 + fuzz/go.sum | 1 + fuzz/provider_go-ds-flatfs.go | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 fuzz/provider_go-ds-flatfs.go diff --git a/fuzz/go.mod b/fuzz/go.mod index bfc815e..63f4b54 100644 --- a/fuzz/go.mod +++ b/fuzz/go.mod @@ -6,5 +6,6 @@ replace github.com/ipfs/go-datastore => ../ require ( github.com/ipfs/go-datastore v0.4.4 + github.com/ipfs/go-ds-flatfs v0.4.4 github.com/spf13/pflag v1.0.3 ) diff --git a/fuzz/go.sum b/fuzz/go.sum index 7e848b3..cbbbcbd 100644 --- a/fuzz/go.sum +++ b/fuzz/go.sum @@ -2,6 +2,7 @@ github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9 h1:HD8gA2tkBy github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5 h1:iW0a5ljuFxkLGPNem5Ui+KBjFJzKg4Fv2fnxe4dvzpM= github.com/alexbrainman/goissue34681 v0.0.0-20191006012335-3fc7a47baff5/go.mod h1:Y2QMoi1vgtOIfc+6DhrMOGkLoGzqSV2rKp4Sm+opsyA= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= diff --git a/fuzz/provider_go-ds-flatfs.go b/fuzz/provider_go-ds-flatfs.go new file mode 100644 index 0000000..e090202 --- /dev/null +++ b/fuzz/provider_go-ds-flatfs.go @@ -0,0 +1,16 @@ +package fuzzer + +import ( + ds "github.com/ipfs/go-datastore" + prov "github.com/ipfs/go-ds-flatfs" +) + +func init() { + AddOpener("go-ds-flatfs", func(loc string) ds.Datastore { + d, err := prov.CreateOrOpen(loc, prov.IPFS_DEF_SHARD, false) + if err != nil { + panic("could not create db instance") + } + return d + }) +}