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

Commit

Permalink
current identity interface (#99)
Browse files Browse the repository at this point in the history
* current identity interface
  • Loading branch information
vitiko authored Apr 26, 2022
1 parent 5f0edc5 commit db66919
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sdk/invoker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
)

type Invoker interface {
CurrentIdentity() msp.SigningIdentity

Query(
ctx context.Context,
chanName string,
Expand Down
4 changes: 4 additions & 0 deletions testing/mocked_peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ func (mp *MockedPeer) WithChannel(channel string, mockStubs ...*MockStub) *Mocke
return mp
}

func (mp *MockedPeer) CurrentIdentity() msp.SigningIdentity {
return nil
}

func (mp *MockedPeer) Invoke(
ctx context.Context,
channel string,
Expand Down
4 changes: 4 additions & 0 deletions testing/mocked_peer_decorator.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ func NewPeerDecorator(sdk sdk.SDK) *MockedPeerDecorator {
}
}

func (mpd *MockedPeerDecorator) CurrentIdentity() msp.SigningIdentity {
return mpd.SDK.CurrentIdentity()
}

func (mpd *MockedPeerDecorator) Invoke(
ctx context.Context,
channel string,
Expand Down

0 comments on commit db66919

Please sign in to comment.