Skip to content

Commit

Permalink
Cleanup: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasse committed Oct 11, 2024
1 parent d3dbeb0 commit 0bc22c5
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions services/rfq/contracts/fastbridge/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func (b BridgeStatus) Int() uint8 {
}

// set all contact types.
//
//nolint:gosec,intrange
func init() {
for i := 0; i < len(_BridgeStatus_index)-1; i++ {
contractType := BridgeStatus(i)
Expand Down
1 change: 1 addition & 0 deletions services/rfq/contracts/fastbridgev2/generate.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package fastbridgev2 is the fast bridge v2 contract.
package fastbridgev2

//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../packages/contracts-rfq/flattened/FastBridgeV2.sol --pkg fastbridgev2 --sol-version 0.8.24 --filename fastbridgev2 --evm-version istanbul
1 change: 0 additions & 1 deletion services/rfq/contracts/fastbridgev2/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ func (p parserImpl) ParseEvent(log ethTypes.Log) (_ EventType, event interface{}
return noOpEvent, nil, false
}
return eventType, disputed, true

}

return eventType, nil, true
Expand Down
2 changes: 2 additions & 0 deletions services/rfq/contracts/fastbridgev2/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func (b BridgeStatus) Int() uint8 {
}

// set all contact types.
//
//nolint:gosec,intrange
func init() {
for i := 0; i < len(_BridgeStatus_index)-1; i++ {
contractType := BridgeStatus(i)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package fastbridgemockv2 is a mock fast bridge contract for testing fast bridge interactions.
package fastbridgemockv2

//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../../packages/contracts-rfq/flattened/FastBridgeMock.sol --pkg fastbridgemockv2 --sol-version 0.8.20 --filename fastbridgemockv2 --evm-version istanbul
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// Package recipientmock is a mock recipient contract for testing fast bridge interactions.
package recipientmock

//go:generate go run github.com/synapsecns/sanguine/tools/abigen generate --sol ../../../../../packages/contracts-rfq/flattened/RecipientMock.sol --pkg recipientmock --sol-version 0.8.20 --filename recipientmock --evm-version istanbul
2 changes: 1 addition & 1 deletion services/rfq/e2e/rfq_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ func (i *IntegrationSuite) TestETHtoETH() {
})
}

//nolint:gosec
func (i *IntegrationSuite) TestArbitraryCall() {
// start the relayer and guard
go func() {
Expand Down Expand Up @@ -501,7 +502,6 @@ func (i *IntegrationSuite) TestArbitraryCall() {
i.NoError(err)
}
}

}()

i.Eventually(func() bool {
Expand Down
2 changes: 2 additions & 0 deletions services/rfq/relayer/reldb/base/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ type Rebalance struct {
// FromQuoteRequest converts a quote request to an object that can be stored in the db.
// TODO: add validation for deadline > uint64
// TODO: roundtripper test.
//
//nolint:gosec
func FromQuoteRequest(request reldb.QuoteRequest) RequestForQuote {
return RequestForQuote{
TransactionID: hexutil.Encode(request.TransactionID[:]),
Expand Down
2 changes: 2 additions & 0 deletions services/rfq/relayer/service/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ var (
// This is the first event emitted in the bridge process. It is emitted when a user calls bridge on chain.
// To process it, we decode the bridge transaction and store all the data, marking it as seen.
// This marks the event as seen.
//
//nolint:cyclop
func (r *Relayer) handleBridgeRequestedLog(parentCtx context.Context, req *fastbridgev2.FastBridgeV2BridgeRequested, chainID uint64) (err error) {
ctx, span := r.metrics.Tracer().Start(parentCtx, "handleBridgeRequestedLog", trace.WithAttributes(
attribute.String("transaction_id", hexutil.Encode(req.TransactionId[:])),
Expand Down
2 changes: 2 additions & 0 deletions services/rfq/relayer/service/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ func (r *RelayerTestSuite) TestStore() {
DestAmount: big.NewInt(2),
Deadline: big.NewInt(3),
})
r.NoError(err)
r.originBackend.WaitForConfirmation(r.GetTestContext(), tx)

r.T().Skip("TODO, test storage")
Expand Down Expand Up @@ -146,6 +147,7 @@ func (r *RelayerTestSuite) TestCommit() {
DestAmount: big.NewInt(2),
Deadline: big.NewInt(3),
})
r.NoError(err)
r.originBackend.WaitForConfirmation(r.GetTestContext(), tx)

r.T().Skip("TODO, test storage")
Expand Down
6 changes: 3 additions & 3 deletions services/rfq/testutil/contracttype.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ const (
FastBridgeType contractTypeImpl = iota + 1 // FastBridge
// MockERC20Type is a mock erc20 contract.
MockERC20Type // MockERC20
// FastBridgeMockType is a mock contract for testing fast bridge interactions
// TODO: rename contract to MockFastBridge.
// FastBridgeMockType is a mock contract for testing fast bridge interactions.
// TODO: rename contract to MockFastBridge.
FastBridgeMockType // FastBridgeMock
// RecipientMockType is a mock contract for testing fast bridge interactions
// RecipientMockType is a mock contract for testing fast bridge interactions.
RecipientMockType // RecipientMock
// WETH9Type is the weth 9 contract.
WETH9Type // WETH9
Expand Down
2 changes: 1 addition & 1 deletion services/rfq/testutil/typecast.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (d *DeployManager) GetMockFastBridge(ctx context.Context, backend backends.
return manager.GetContract[*fastbridgemockv2.FastBridgeMockRef](ctx, d.T(), d, backend, FastBridgeMockType)
}

// GetMockRecipient gets the mock recipient.
// GetRecipientMock gets the mock recipient.
func (d *DeployManager) GetRecipientMock(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *recipientmock.RecipientMockRef) {
d.T().Helper()

Expand Down

0 comments on commit 0bc22c5

Please sign in to comment.