Skip to content

Commit

Permalink
fix delete private key from mockStub (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
SiriusPluge authored Jan 9, 2024
1 parent 9d9c9cc commit 4060058
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions testing/mockstub.go
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,7 @@ func (stub *MockStub) DelPrivateData(collection string, key string) error {
return errors.Errorf("Collection %s not found.", collection)
}

if _, ok := m[key]; !ok {
return errors.Errorf("Key %s not found.", key)
}
// If m is nil or there is no such element, delete is a no-op.
delete(m, key)

for elem := stub.PrivateKeys[collection].Front(); elem != nil; elem = elem.Next() {
Expand Down

0 comments on commit 4060058

Please sign in to comment.