Skip to content
Snippets Groups Projects
Commit e87a5c66 authored by David Stainton's avatar David Stainton
Browse files

fix addPartErr

parent 4ddc394c
No related branches found
No related tags found
3 merge requests!170Release,!128Xx 3678/ft cha cha20,!126Dev
......@@ -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
......
......@@ -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 "+
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment