Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit db66919

Browse files
authored
current identity interface (#99)
* current identity interface
1 parent 5f0edc5 commit db66919

3 files changed

Lines changed: 10 additions & 0 deletions

File tree

sdk/invoker.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import (
88
)
99

1010
type Invoker interface {
11+
CurrentIdentity() msp.SigningIdentity
12+
1113
Query(
1214
ctx context.Context,
1315
chanName string,

testing/mocked_peer.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func (mp *MockedPeer) WithChannel(channel string, mockStubs ...*MockStub) *Mocke
6060
return mp
6161
}
6262

63+
func (mp *MockedPeer) CurrentIdentity() msp.SigningIdentity {
64+
return nil
65+
}
66+
6367
func (mp *MockedPeer) Invoke(
6468
ctx context.Context,
6569
channel string,

testing/mocked_peer_decorator.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ func NewPeerDecorator(sdk sdk.SDK) *MockedPeerDecorator {
5353
}
5454
}
5555

56+
func (mpd *MockedPeerDecorator) CurrentIdentity() msp.SigningIdentity {
57+
return mpd.SDK.CurrentIdentity()
58+
}
59+
5660
func (mpd *MockedPeerDecorator) Invoke(
5761
ctx context.Context,
5862
channel string,

0 commit comments

Comments
 (0)