Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/ethersphere/bee into beek…
Browse files Browse the repository at this point in the history
…eeper-test
  • Loading branch information
gacevicljubisa committed Dec 21, 2023
2 parents 41a5deb + ad2602c commit 1efdae6
Show file tree
Hide file tree
Showing 18 changed files with 177 additions and 133 deletions.
30 changes: 17 additions & 13 deletions cmd/bee/cmd/split.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,18 @@ package cmd
import (
"context"
"fmt"
"io"
"os"
"strings"

"github.com/ethersphere/bee/pkg/file"
"github.com/ethersphere/bee/pkg/file/splitter"
"github.com/ethersphere/bee/pkg/file/pipeline/builder"
"github.com/ethersphere/bee/pkg/storage"
"github.com/ethersphere/bee/pkg/swarm"
"github.com/spf13/cobra"
)

// putter is a putter that stores all the split chunk addresses of a file
type putter struct {
rootHash string
chunkAddresses []string
}

Expand All @@ -30,6 +29,15 @@ func (s *putter) Put(ctx context.Context, chunk swarm.Chunk) error {

var _ storage.Putter = (*putter)(nil)

type pipelineFunc func(context.Context, io.Reader) (swarm.Address, error)

func requestPipelineFn(s storage.Putter, encrypt bool) pipelineFunc {
return func(ctx context.Context, r io.Reader) (swarm.Address, error) {
pipe := builder.NewPipelineBuilder(ctx, s, encrypt)
return builder.FeedPipeline(ctx, pipe, r)
}
}

func (c *command) initSplitCmd() error {
optionNameInputFile := "input-file"
optionNameOutputFile := "output-file"
Expand Down Expand Up @@ -64,16 +72,12 @@ func (c *command) initSplitCmd() error {

logger.Info("splitting", "file", inputFileName)
store := new(putter)
s := splitter.NewSimpleSplitter(store)
stat, err := reader.Stat()
if err != nil {
return fmt.Errorf("stat file: %w", err)
}
rootHash, err := file.SplitWriteAll(context.Background(), s, reader, stat.Size(), false)

p := requestPipelineFn(store, false)
address, err := p(context.Background(), reader)
if err != nil {
return fmt.Errorf("split write: %w", err)
return fmt.Errorf("bmt pipeline: %w", err)
}
store.rootHash = rootHash.String()

logger.Info("writing output", "file", outputFileName)
writer, err := os.OpenFile(outputFileName, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
Expand All @@ -82,8 +86,8 @@ func (c *command) initSplitCmd() error {
}
defer writer.Close()

logger.Debug("write root", "hash", store.rootHash)
_, err = writer.WriteString(fmt.Sprintf("%s\n", store.rootHash))
logger.Debug("write root", "hash", address)
_, err = writer.WriteString(fmt.Sprintf("%s\n", address))
if err != nil {
return fmt.Errorf("write root hash: %w", err)
}
Expand Down
12 changes: 6 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.21
require (
contrib.go.opencensus.io/exporter/prometheus v0.4.2
github.com/armon/go-radix v1.0.0
github.com/btcsuite/btcd v0.22.3
github.com/btcsuite/btcd/btcec/v2 v2.3.2
github.com/casbin/casbin/v2 v2.35.0
github.com/coreos/go-semver v0.3.0
github.com/ethereum/go-ethereum v1.13.4
Expand Down Expand Up @@ -42,12 +42,12 @@ require (
gitlab.com/nolash/go-mockbytes v0.0.7
go.uber.org/atomic v1.11.0
go.uber.org/goleak v1.2.0
golang.org/x/crypto v0.14.0
golang.org/x/crypto v0.17.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/net v0.17.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.13.0
golang.org/x/term v0.13.0
golang.org/x/sys v0.15.0
golang.org/x/term v0.15.0
golang.org/x/time v0.3.0
gopkg.in/yaml.v2 v2.4.0
resenje.org/multex v0.1.0
Expand All @@ -63,7 +63,7 @@ require (
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.7.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.0 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/codahale/hdrhistogram v0.0.0-00010101000000-000000000000 // indirect
github.com/consensys/bavard v0.1.13 // indirect
Expand Down Expand Up @@ -169,7 +169,7 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/mod v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.13.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/ini.v1 v1.57.0 // indirect
Expand Down
22 changes: 10 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@ github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx2
github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g=
github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ=
github.com/btcsuite/btcd v0.22.0-beta/go.mod h1:9n5ntfhhHQBIhUvlhDvD3Qg6fRUj4jkN0VB8L8svzOA=
github.com/btcsuite/btcd v0.22.3 h1:kYNaWFvOw6xvqP0vR20RP1Zq1DVMBxEO8QN5d1/EfNg=
github.com/btcsuite/btcd v0.22.3/go.mod h1:wqgTSL29+50LRkmOVknEdmt8ZojIzhuWvgu/iptuN7Y=
github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k=
github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU=
github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U=
github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA=
Expand Down Expand Up @@ -1010,8 +1008,8 @@ golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWP
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down Expand Up @@ -1210,13 +1208,13 @@ golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -1225,8 +1223,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down
3 changes: 1 addition & 2 deletions pkg/api/pss_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"testing"
"time"

"github.com/btcsuite/btcd/btcec"
"github.com/ethersphere/bee/pkg/api"
"github.com/ethersphere/bee/pkg/crypto"
"github.com/ethersphere/bee/pkg/jsonhttp"
Expand Down Expand Up @@ -171,7 +170,7 @@ func TestPssSend(t *testing.T) {
done bool

privk, _ = crypto.GenerateSecp256k1Key()
publicKeyBytes = (*btcec.PublicKey)(&privk.PublicKey).SerializeCompressed()
publicKeyBytes = crypto.EncodeSecp256k1PublicKey(&privk.PublicKey)

sendFn = func(ctx context.Context, targets pss.Targets, chunk swarm.Chunk) error {
mtx.Lock()
Expand Down
18 changes: 11 additions & 7 deletions pkg/crypto/crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"errors"
"fmt"

"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/ethersphere/bee/pkg/swarm"
"golang.org/x/crypto/sha3"
)
Expand Down Expand Up @@ -66,21 +66,25 @@ func GenerateSecp256k1Key() (*ecdsa.PrivateKey, error) {

// EncodeSecp256k1PrivateKey encodes raw ECDSA private key.
func EncodeSecp256k1PrivateKey(k *ecdsa.PrivateKey) ([]byte, error) {
return (*btcec.PrivateKey)(k).Serialize(), nil
pvk, _ := btcec.PrivKeyFromBytes(k.D.Bytes())
return pvk.Serialize(), nil
}

// EncodeSecp256k1PublicKey encodes raw ECDSA public key in a 33-byte compressed format.
func EncodeSecp256k1PublicKey(k *ecdsa.PublicKey) []byte {
return (*btcec.PublicKey)(k).SerializeCompressed()
var x, y btcec.FieldVal
x.SetByteSlice(k.X.Bytes())
y.SetByteSlice(k.Y.Bytes())
return btcec.NewPublicKey(&x, &y).SerializeCompressed()
}

// DecodeSecp256k1PrivateKey decodes raw ECDSA private key.
func DecodeSecp256k1PrivateKey(data []byte) (*ecdsa.PrivateKey, error) {
if l := len(data); l != btcec.PrivKeyBytesLen {
return nil, fmt.Errorf("secp256k1 data size %d expected %d", l, btcec.PrivKeyBytesLen)
}
privk, _ := btcec.PrivKeyFromBytes(btcec.S256(), data)
return (*ecdsa.PrivateKey)(privk), nil
pvk, _ := btcec.PrivKeyFromBytes(data)
return pvk.ToECDSA(), nil
}

// GenerateSecp256k1Key generates an ECDSA private key using
Expand All @@ -102,8 +106,8 @@ func DecodeSecp256r1PrivateKey(data []byte) (*ecdsa.PrivateKey, error) {
// Secp256k1PrivateKeyFromBytes returns an ECDSA private key based on
// the byte slice.
func Secp256k1PrivateKeyFromBytes(data []byte) *ecdsa.PrivateKey {
privk, _ := btcec.PrivKeyFromBytes(btcec.S256(), data)
return (*ecdsa.PrivateKey)(privk)
pvk, _ := btcec.PrivKeyFromBytes(data)
return pvk.ToECDSA()
}

// NewEthereumAddress returns a binary representation of ethereum blockchain address.
Expand Down
7 changes: 3 additions & 4 deletions pkg/crypto/dh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,12 @@ package crypto_test

import (
"bytes"
"crypto/ecdsa"
"crypto/rand"
"encoding/hex"
"io"
"testing"

"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/ethersphere/bee/pkg/crypto"
)

Expand Down Expand Up @@ -66,7 +65,7 @@ func TestSharedKey(t *testing.T) {
if err != nil {
t.Fatal(err)
}
pubkey, err := btcec.ParsePubKey(data, btcec.S256())
pubkey, err := btcec.ParsePubKey(data)
if err != nil {
t.Fatal(err)
}
Expand All @@ -76,7 +75,7 @@ func TestSharedKey(t *testing.T) {
}

dh := crypto.NewDH(privKey)
sk, err := dh.SharedKey((*ecdsa.PublicKey)(pubkey), salt)
sk, err := dh.SharedKey(pubkey.ToECDSA(), salt)
if err != nil {
t.Fatal(err)
}
Expand Down
20 changes: 14 additions & 6 deletions pkg/crypto/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (
"fmt"
"math/big"

"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/btcec/v2"
btcecdsa "github.com/btcsuite/btcd/btcec/v2/ecdsa"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethersphere/bee/pkg/crypto/eip712"
Expand Down Expand Up @@ -59,8 +60,11 @@ func Recover(signature, data []byte) (*ecdsa.PublicKey, error) {
return nil, err
}

p, _, err := btcec.RecoverCompact(btcec.S256(), btcsig, hash)
return (*ecdsa.PublicKey)(p), err
pbk, _, err := btcecdsa.RecoverCompact(btcsig, hash)
if err != nil {
return nil, err
}
return pbk.ToECDSA(), err
}

type defaultSigner struct {
Expand Down Expand Up @@ -135,7 +139,8 @@ func (d *defaultSigner) SignTypedData(typedData *eip712.TypedData) ([]byte, erro

// sign the provided hash and convert it to the ethereum (r,s,v) format.
func (d *defaultSigner) sign(sighash []byte, isCompressedKey bool) ([]byte, error) {
signature, err := btcec.SignCompact(btcec.S256(), (*btcec.PrivateKey)(d.key), sighash, false)
pvk, _ := btcec.PrivKeyFromBytes(d.key.D.Bytes())
signature, err := btcecdsa.SignCompact(pvk, sighash, false)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -167,6 +172,9 @@ func RecoverEIP712(signature []byte, data *eip712.TypedData) (*ecdsa.PublicKey,
return nil, err
}

p, _, err := btcec.RecoverCompact(btcec.S256(), btcsig, sighash)
return (*ecdsa.PublicKey)(p), err
pbk, _, err := btcecdsa.RecoverCompact(btcsig, sighash)
if err != nil {
return nil, err
}
return pbk.ToECDSA(), err
}
2 changes: 1 addition & 1 deletion pkg/keystore/file/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"fmt"
"io"

"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/ethersphere/bee/pkg/crypto"
"github.com/ethersphere/bee/pkg/keystore"
"github.com/google/uuid"
Expand Down
2 changes: 1 addition & 1 deletion pkg/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ const (
maxPaymentThreshold = 24 * refreshRate // maximal accepted payment threshold of full nodes
mainnetNetworkID = uint64(1) //
ReserveCapacity = 4_194_304 // 2^22 chunks
reserveWakeUpDuration = 15 * time.Minute // time to wait before waking up reserveWorker
reserveWakeUpDuration = 30 * time.Minute // time to wait before waking up reserveWorker
reserveTreshold = ReserveCapacity * 5 / 10
reserveMinimumRadius = 0
)
Expand Down
31 changes: 20 additions & 11 deletions pkg/postage/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,33 +223,32 @@ func TestSetExpired(t *testing.T) {
t.Fatal(err)
}

err = store.Put(postage.NewStampItem().WithChunkAddress(swarm.RandAddress(t)).WithBatchID(batch))
itemExists := postage.NewStampItem().WithChunkAddress(swarm.RandAddress(t)).WithBatchID(batch)
err = store.Put(itemExists)
if err != nil {
t.Fatal(err)
}

err = store.Put(postage.NewStampItem().WithChunkAddress(swarm.RandAddress(t)).WithBatchID(notExistsBatch))
itemNotExists := postage.NewStampItem().WithChunkAddress(swarm.RandAddress(t)).WithBatchID(notExistsBatch)
err = store.Put(itemNotExists)
if err != nil {
t.Fatal(err)
}

issuer := newTestStampIssuer(t, 1000)
err = ps.Add(issuer)
err = ps.Add(newTestStampIssuerID(t, 1000, itemExists.BatchID))
if err != nil {
t.Fatal(err)
}

_, _, err = ps.GetStampIssuer(issuer.ID())
if !errors.Is(err, postage.ErrNotUsable) {
t.Fatalf("expected %v, got %v", postage.ErrNotUsable, err)
err = ps.Add(newTestStampIssuerID(t, 1000, itemNotExists.BatchID))
if err != nil {
t.Fatal(err)
}

err = ps.HandleStampExpiry(context.Background(), issuer.ID())
err = ps.HandleStampExpiry(context.Background(), itemNotExists.BatchID)
if err != nil {
t.Fatal(err)
}

_, _, err = ps.GetStampIssuer(issuer.ID())
_, _, err = ps.GetStampIssuer(itemNotExists.BatchID)
if !errors.Is(err, postage.ErrNotFound) {
t.Fatalf("expected %v, got %v", postage.ErrNotFound, err)
}
Expand Down Expand Up @@ -281,5 +280,15 @@ func TestSetExpired(t *testing.T) {
t.Fatal(err)
}

err = store.Get(itemExists)
if err != nil {
t.Fatal(err)
}

err = store.Get(itemNotExists)
if err == nil {
t.Fatal(err)
}

testutil.CleanupCloser(t, ps)
}
Loading

0 comments on commit 1efdae6

Please sign in to comment.