Skip to content

Commit d4beab0

Browse files
committed
[FAB-12089] Add private metadata getter by hash
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>
1 parent e5547f2 commit d4beab0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/common/validation/statebased/vpmanager_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ func (ms *mockState) GetPrivateDataMetadata(namespace, collection, key string) (
4949
return ms.GetPrivateDataMetadataRv, ms.GetPrivateDataMetadataErr
5050
}
5151

52+
func (ms *mockState) GetPrivateDataMetadataByHash(namespace, collection string, keyhash []byte) (map[string][]byte, error) {
53+
return nil, nil
54+
}
55+
5256
func (ms *mockState) Done() {
5357
ms.DoneCalled = true
5458
}

core/handlers/validation/api/state/state.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ type State interface {
2828
// GetPrivateDataMetadata gets the metadata of a private data item identified by a tuple <namespace, collection, key>
2929
GetPrivateDataMetadata(namespace, collection, key string) (map[string][]byte, error)
3030

31+
// GetPrivateDataMetadataByHash gets the metadata of a private data item identified by a tuple <namespace, collection, keyhash>
32+
GetPrivateDataMetadataByHash(namespace, collection string, keyhash []byte) (map[string][]byte, error)
33+
3134
// Done releases resources occupied by the State
3235
Done()
3336
}

0 commit comments

Comments
 (0)