-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign get chunks #1022
Sign get chunks #1022
Changes from all commits
8bf1fa0
5ce2082
73583d8
7309c0e
c818bee
a073a28
8bf552b
cb1e42c
4743516
4c12228
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package mock | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need a separate mock for relay? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing |
||
|
||
import ( | ||
"context" | ||
"github.com/Layr-Labs/eigenda/core" | ||
"github.com/stretchr/testify/mock" | ||
) | ||
|
||
var _ core.IndexedChainState = (*IndexedChainState)(nil) | ||
|
||
// IndexedChainState is a mock implementation of core.IndexedChainState. | ||
type IndexedChainState struct { | ||
Mock mock.Mock | ||
} | ||
|
||
func (m *IndexedChainState) GetCurrentBlockNumber() (uint, error) { | ||
args := m.Mock.Called() | ||
return args.Get(0).(uint), args.Error(1) | ||
} | ||
|
||
func (m *IndexedChainState) GetOperatorState( | ||
ctx context.Context, | ||
blockNumber uint, | ||
quorums []core.QuorumID) (*core.OperatorState, error) { | ||
|
||
args := m.Mock.Called(blockNumber, quorums) | ||
return args.Get(0).(*core.OperatorState), args.Error(1) | ||
} | ||
|
||
func (m *IndexedChainState) GetOperatorStateByOperator( | ||
ctx context.Context, | ||
blockNumber uint, | ||
operator core.OperatorID) (*core.OperatorState, error) { | ||
|
||
args := m.Mock.Called(blockNumber, operator) | ||
return args.Get(0).(*core.OperatorState), args.Error(1) | ||
} | ||
|
||
func (m *IndexedChainState) GetOperatorSocket( | ||
ctx context.Context, | ||
blockNumber uint, | ||
operator core.OperatorID) (string, error) { | ||
|
||
args := m.Mock.Called(blockNumber, operator) | ||
return args.Get(0).(string), args.Error(1) | ||
} | ||
|
||
func (m *IndexedChainState) GetIndexedOperatorState( | ||
ctx context.Context, | ||
blockNumber uint, | ||
quorums []core.QuorumID) (*core.IndexedOperatorState, error) { | ||
|
||
args := m.Mock.Called(blockNumber, quorums) | ||
return args.Get(0).(*core.IndexedOperatorState), args.Error(1) | ||
} | ||
|
||
func (m *IndexedChainState) GetIndexedOperators( | ||
ctx context.Context, | ||
blockNumber uint) (map[core.OperatorID]*core.IndexedOperatorInfo, error) { | ||
|
||
args := m.Mock.Called(blockNumber) | ||
return args.Get(0).(map[core.OperatorID]*core.IndexedOperatorInfo), args.Error(1) | ||
} | ||
|
||
func (m *IndexedChainState) Start(context context.Context) error { | ||
args := m.Mock.Called() | ||
return args.Error(0) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To confirm, all the values of the request are being hashed right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as long as I didn't make a mistake when coding the hashing function. Makes me nervous writing these types of things by hand due to the possibility of human error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good area to focus for auditors