-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge master into m2 mainnet contracts (#220)
Co-authored-by: siddimore <[email protected]> Co-authored-by: Ian Shim <[email protected]> Co-authored-by: bolatfurkan <[email protected]> Co-authored-by: Peter Straus <[email protected]> Co-authored-by: WELLINGTON MIRANDA BARBOSA <[email protected]> Co-authored-by: Wellington Barbosa <[email protected]> Co-authored-by: Jian Xiao <[email protected]> Co-authored-by: buldazer <[email protected]> Co-authored-by: Madhur Shrimal <[email protected]> Co-authored-by: Daniel Mancia <[email protected]> Co-authored-by: Jian Xiao <[email protected]>
- Loading branch information
1 parent
d104c9d
commit 0efdbf0
Showing
82 changed files
with
1,683 additions
and
670 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package mock | ||
|
||
import ( | ||
"context" | ||
"errors" | ||
|
||
"github.com/Layr-Labs/eigenda/api/grpc/disperser" | ||
|
||
"google.golang.org/grpc" | ||
) | ||
|
||
func MakeStreamMock(ctx context.Context) *StreamMock { | ||
return &StreamMock{ | ||
ctx: ctx, | ||
recvToServer: make(chan *disperser.AuthenticatedRequest, 10), | ||
sentFromServer: make(chan *disperser.AuthenticatedReply, 10), | ||
} | ||
} | ||
|
||
type StreamMock struct { | ||
grpc.ServerStream | ||
ctx context.Context | ||
recvToServer chan *disperser.AuthenticatedRequest | ||
sentFromServer chan *disperser.AuthenticatedReply | ||
} | ||
|
||
func (m *StreamMock) Context() context.Context { | ||
return m.ctx | ||
} | ||
|
||
func (m *StreamMock) Send(resp *disperser.AuthenticatedReply) error { | ||
m.sentFromServer <- resp | ||
return nil | ||
} | ||
|
||
func (m *StreamMock) Recv() (*disperser.AuthenticatedRequest, error) { | ||
req, more := <-m.recvToServer | ||
if !more { | ||
return nil, errors.New("empty") | ||
} | ||
return req, nil | ||
} | ||
|
||
func (m *StreamMock) SendFromClient(req *disperser.AuthenticatedRequest) error { | ||
m.recvToServer <- req | ||
return nil | ||
} | ||
|
||
func (m *StreamMock) RecvToClient() (*disperser.AuthenticatedReply, error) { | ||
response, more := <-m.sentFromServer | ||
if !more { | ||
return nil, errors.New("empty") | ||
} | ||
return response, nil | ||
} | ||
|
||
func (m *StreamMock) Close() { | ||
close(m.recvToServer) | ||
close(m.sentFromServer) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.