Skip to content

Commit

Permalink
[FAB-12089] Add private metadata getter by hash
Browse files Browse the repository at this point in the history
This change set adds GetPrivateDataMetadataByHash to the State
interface of validation plugins so that metadata for private keys
can be retrieved by the key hash.

Change-Id: I96f926a7d6ef142b1a7f58153aad55190ab4dfc5
Signed-off-by: Alessandro Sorniotti <ale.linux@sopit.net>
Signed-off-by: Matthias Neugschwandtner <eug@zurich.ibm.com>
  • Loading branch information
ale-linux committed Sep 21, 2018
1 parent e5547f2 commit d4beab0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/common/validation/statebased/vpmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func (ms *mockState) GetPrivateDataMetadata(namespace, collection, key string) (
return ms.GetPrivateDataMetadataRv, ms.GetPrivateDataMetadataErr
}

func (ms *mockState) GetPrivateDataMetadataByHash(namespace, collection string, keyhash []byte) (map[string][]byte, error) {
return nil, nil
}

func (ms *mockState) Done() {
ms.DoneCalled = true
}
Expand Down
3 changes: 3 additions & 0 deletions core/handlers/validation/api/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ type State interface {
// GetPrivateDataMetadata gets the metadata of a private data item identified by a tuple <namespace, collection, key>
GetPrivateDataMetadata(namespace, collection, key string) (map[string][]byte, error)

// GetPrivateDataMetadataByHash gets the metadata of a private data item identified by a tuple <namespace, collection, keyhash>
GetPrivateDataMetadataByHash(namespace, collection string, keyhash []byte) (map[string][]byte, error)

// Done releases resources occupied by the State
Done()
}
Expand Down

0 comments on commit d4beab0

Please sign in to comment.