Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
ae036e06
Unverified
Commit
ae036e06
authored
May 18, 2021
by
acud
Committed by
GitHub
May 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(postage): dont swallow error (#1762)
parent
bec3daec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
reserve_test.go
pkg/postage/batchstore/reserve_test.go
+1
-1
stamp.go
pkg/postage/stamp.go
+3
-2
No files found.
pkg/postage/batchstore/reserve_test.go
View file @
ae036e06
...
...
@@ -159,7 +159,7 @@ func TestBatchStoreUnreserveAll(t *testing.T) {
n
:=
rand
.
Intn
(
len
(
batches
))
b
,
err
=
bStore
.
Get
(
batches
[
n
])
if
err
!=
nil
{
if
errors
.
Is
(
storage
.
ErrNotFound
,
err
)
{
if
errors
.
Is
(
err
,
storage
.
ErrNotFound
)
{
continue
}
t
.
Fatal
(
err
)
...
...
pkg/postage/stamp.go
View file @
ae036e06
...
...
@@ -7,6 +7,7 @@ package postage
import
(
"bytes"
"errors"
"fmt"
"github.com/ethersphere/bee/pkg/crypto"
"github.com/ethersphere/bee/pkg/storage"
...
...
@@ -115,12 +116,12 @@ func ValidStamp(batchStore Storer) func(chunk swarm.Chunk, stampBytes []byte) (s
b
,
err
:=
batchStore
.
Get
(
stamp
.
BatchID
())
if
err
!=
nil
{
if
errors
.
Is
(
err
,
storage
.
ErrNotFound
)
{
return
nil
,
ErrNotFound
return
nil
,
fmt
.
Errorf
(
"batchstore get: %v, %w"
,
err
,
ErrNotFound
)
}
return
nil
,
err
}
if
err
=
stamp
.
Valid
(
chunk
.
Address
(),
b
.
Owner
);
err
!=
nil
{
return
nil
,
err
return
nil
,
fmt
.
Errorf
(
"chunk %s stamp invalid: %w"
,
chunk
.
Address
()
.
String
(),
err
)
}
return
chunk
.
WithStamp
(
stamp
)
.
WithBatch
(
b
.
Radius
,
b
.
Depth
),
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment