Skip to content

Commit becb83c

Browse files
authored
chore: make format golines (#1211)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 8981d3f commit becb83c

File tree

3 files changed

+45
-12
lines changed

3 files changed

+45
-12
lines changed

protocol/leiosfetch/client.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ func (c *Client) Stop() error {
122122
}
123123

124124
// BlockRequest fetches the requested EB identified by the slot and Leios hash
125-
func (c *Client) BlockRequest(slot uint64, hash []byte) (protocol.Message, error) {
125+
func (c *Client) BlockRequest(
126+
slot uint64,
127+
hash []byte,
128+
) (protocol.Message, error) {
126129
msg := NewMsgBlockRequest(slot, hash)
127130
if err := c.SendMessage(msg); err != nil {
128131
return nil, err
@@ -135,7 +138,11 @@ func (c *Client) BlockRequest(slot uint64, hash []byte) (protocol.Message, error
135138
}
136139

137140
// BlockTxsRequest fetches the requested TXs identified by the slot, Leios hash, and TX bitmap
138-
func (c *Client) BlockTxsRequest(slot uint64, hash []byte, txBitmap [8]byte) (protocol.Message, error) {
141+
func (c *Client) BlockTxsRequest(
142+
slot uint64,
143+
hash []byte,
144+
txBitmap [8]byte,
145+
) (protocol.Message, error) {
139146
msg := NewMsgBlockTxsRequest(slot, hash, txBitmap)
140147
if err := c.SendMessage(msg); err != nil {
141148
return nil, err
@@ -148,7 +155,9 @@ func (c *Client) BlockTxsRequest(slot uint64, hash []byte, txBitmap [8]byte) (pr
148155
}
149156

150157
// VotesRequest fetches the requested votes
151-
func (c *Client) VotesRequest(voteIds []MsgVotesRequestVoteId) (protocol.Message, error) {
158+
func (c *Client) VotesRequest(
159+
voteIds []MsgVotesRequestVoteId,
160+
) (protocol.Message, error) {
152161
msg := NewMsgVotesRequest(voteIds)
153162
if err := c.SendMessage(msg); err != nil {
154163
return nil, err
@@ -162,7 +171,10 @@ func (c *Client) VotesRequest(voteIds []MsgVotesRequestVoteId) (protocol.Message
162171

163172
// BlockRangeRequest fetches a range of EBs and their TXs that are certified by RBs within the provided range.
164173
// This function will block until all EBs and TXs in the requested range have been received
165-
func (c *Client) BlockRangeRequest(start pcommon.Point, end pcommon.Point) ([]protocol.Message, error) {
174+
func (c *Client) BlockRangeRequest(
175+
start pcommon.Point,
176+
end pcommon.Point,
177+
) ([]protocol.Message, error) {
166178
msg := NewMsgBlockRangeRequest(start, end)
167179
if err := c.SendMessage(msg); err != nil {
168180
return nil, err

protocol/leiosfetch/leiosfetch.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,29 +157,37 @@ func NewConfig(options ...LeiosFetchOptionFunc) Config {
157157
}
158158

159159
// WithBlockRequestFunc specifies a callback function for BlockRequest messages when acting as a server. The callback is expected to return the proper response message and an error
160-
func WithBlockRequestFunc(blockRequestFunc BlockRequestFunc) LeiosFetchOptionFunc {
160+
func WithBlockRequestFunc(
161+
blockRequestFunc BlockRequestFunc,
162+
) LeiosFetchOptionFunc {
161163
return func(c *Config) {
162164
c.BlockRequestFunc = blockRequestFunc
163165
}
164166
}
165167

166168
// WithBlockTxsRequestFunc specifies a callback function for BlockTxsRequest messages when acting as a server. The callback is expected to return the proper response message and an error
167-
func WithBlockTxsRequestFunc(blockTxsRequestFunc BlockTxsRequestFunc) LeiosFetchOptionFunc {
169+
func WithBlockTxsRequestFunc(
170+
blockTxsRequestFunc BlockTxsRequestFunc,
171+
) LeiosFetchOptionFunc {
168172
return func(c *Config) {
169173
c.BlockTxsRequestFunc = blockTxsRequestFunc
170174
}
171175
}
172176

173177
// WithVotesRequestFunc specifies a callback function for VotesRequest messages when acting as a server. The callback is expected to return the proper response message and an error
174-
func WithVotesRequestFunc(votesRequestFunc VotesRequestFunc) LeiosFetchOptionFunc {
178+
func WithVotesRequestFunc(
179+
votesRequestFunc VotesRequestFunc,
180+
) LeiosFetchOptionFunc {
175181
return func(c *Config) {
176182
c.VotesRequestFunc = votesRequestFunc
177183
}
178184
}
179185

180186
// WithBlockRangeRequestFunc specifies a callback function for BlockRangeRequest messages when acting as a server. The callback is expected to return an error and start an async process
181187
// to generate and send LastBlockAndTxsInRange and NextBlockAndTxsInRange messages that satisfy the requested range
182-
func WithBlockRangeRequestFunc(blockRangeRequestFunc BlockRangeRequestFunc) LeiosFetchOptionFunc {
188+
func WithBlockRangeRequestFunc(
189+
blockRangeRequestFunc BlockRangeRequestFunc,
190+
) LeiosFetchOptionFunc {
183191
return func(c *Config) {
184192
c.BlockRangeRequestFunc = blockRangeRequestFunc
185193
}

protocol/leiosfetch/messages.go

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@ type MsgBlockTxsRequest struct {
111111
TxBitmap [8]byte
112112
}
113113

114-
func NewMsgBlockTxsRequest(slot uint64, hash []byte, txBitmap [8]byte) *MsgBlockTxsRequest {
114+
func NewMsgBlockTxsRequest(
115+
slot uint64,
116+
hash []byte,
117+
txBitmap [8]byte,
118+
) *MsgBlockTxsRequest {
115119
m := &MsgBlockTxsRequest{
116120
MessageBase: protocol.MessageBase{
117121
MessageType: MessageTypeBlockTxsRequest,
@@ -180,7 +184,10 @@ type MsgBlockRangeRequest struct {
180184
End pcommon.Point
181185
}
182186

183-
func NewMsgBlockRangeRequest(start pcommon.Point, end pcommon.Point) *MsgBlockRangeRequest {
187+
func NewMsgBlockRangeRequest(
188+
start pcommon.Point,
189+
end pcommon.Point,
190+
) *MsgBlockRangeRequest {
184191
m := &MsgBlockRangeRequest{
185192
MessageBase: protocol.MessageBase{
186193
MessageType: MessageTypeBlockRangeRequest,
@@ -197,7 +204,10 @@ type MsgNextBlockAndTxsInRange struct {
197204
TxsRaw []cbor.RawMessage
198205
}
199206

200-
func NewMsgNextBlockAndTxsInRange(block cbor.RawMessage, txs []cbor.RawMessage) *MsgNextBlockAndTxsInRange {
207+
func NewMsgNextBlockAndTxsInRange(
208+
block cbor.RawMessage,
209+
txs []cbor.RawMessage,
210+
) *MsgNextBlockAndTxsInRange {
201211
m := &MsgNextBlockAndTxsInRange{
202212
MessageBase: protocol.MessageBase{
203213
MessageType: MessageTypeNextBlockAndTxsInRange,
@@ -214,7 +224,10 @@ type MsgLastBlockAndTxsInRange struct {
214224
TxsRaw []cbor.RawMessage
215225
}
216226

217-
func NewMsgLastBlockAndTxsInRange(block cbor.RawMessage, txs []cbor.RawMessage) *MsgLastBlockAndTxsInRange {
227+
func NewMsgLastBlockAndTxsInRange(
228+
block cbor.RawMessage,
229+
txs []cbor.RawMessage,
230+
) *MsgLastBlockAndTxsInRange {
218231
m := &MsgLastBlockAndTxsInRange{
219232
MessageBase: protocol.MessageBase{
220233
MessageType: MessageTypeLastBlockAndTxsInRange,

0 commit comments

Comments
 (0)