Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
e87a5c66
Commit
e87a5c66
authored
3 years ago
by
David Stainton
Browse files
Options
Downloads
Patches
Plain Diff
fix addPartErr
parent
4ddc394c
No related branches found
No related tags found
3 merge requests
!170
Release
,
!128
Xx 3678/ft cha cha20
,
!126
Dev
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
storage/fileTransfer/receiveFileTransfers.go
+2
-2
2 additions, 2 deletions
storage/fileTransfer/receiveFileTransfers.go
storage/fileTransfer/receiveFileTransfers_test.go
+1
-2
1 addition, 2 deletions
storage/fileTransfer/receiveFileTransfers_test.go
with
3 additions
and
4 deletions
storage/fileTransfer/receiveFileTransfers.go
+
2
−
2
View file @
e87a5c66
...
...
@@ -35,7 +35,7 @@ const (
getReceivedTransferErr
=
"received transfer with ID %s not found"
addTransferNewIdErr
=
"could not generate new transfer ID: %+v"
noFingerprintErr
=
"no part found with fingerprint %s"
addPartErr
=
"failed to add part
number %d/%d
to transfer %s: %+v"
addPartErr
=
"failed to add part to transfer %s: %+v"
deleteReceivedTransferErr
=
"failed to delete received transfer with ID %s from store: %+v"
)
...
...
@@ -201,7 +201,7 @@ func (rft *ReceivedFileTransfersStore) AddPart(cmixMsg format.Message) (*Receive
completed
,
err
:=
transfer
.
AddPart
(
cmixMsg
,
info
.
fpNum
)
if
err
!=
nil
{
return
transfer
,
info
.
id
,
false
,
errors
.
Errorf
(
addPartErr
,
transfer
.
numParts
,
info
.
id
,
err
)
addPartErr
,
info
.
id
,
err
)
}
// Remove the part info from the map
...
...
This diff is collapsed.
Click to expand it.
storage/fileTransfer/receiveFileTransfers_test.go
+
1
−
2
View file @
e87a5c66
...
...
@@ -478,7 +478,7 @@ func TestReceivedFileTransfersStore_AddPart_AddPartError(t *testing.T) {
fp
:=
ftCrypto
.
GenerateFingerprint
(
key
,
fpNum
)
// Add encrypted part
expectedErr
:=
fmt
.
Sprintf
(
addPartErr
,
partNum
,
numParts
,
tid
,
""
)
expectedErr
:=
fmt
.
Sprintf
(
addPartErr
,
tid
,
""
)
cmixMsg
:=
format
.
NewMessage
(
format
.
MinimumPrimeSize
)
...
...
@@ -490,7 +490,6 @@ func TestReceivedFileTransfersStore_AddPart_AddPartError(t *testing.T) {
cmixMsg
.
SetContents
(
partData
.
Marshal
())
cmixMsg
.
SetMac
(
mac
)
_
,
_
,
_
,
err
=
rft
.
AddPart
(
cmixMsg
)
if
err
==
nil
||
!
strings
.
Contains
(
err
.
Error
(),
expectedErr
)
{
t
.
Errorf
(
"AddPart did not return the expected error when the "
+
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment