Skip to content

Commit

Permalink
Merge branch 'master' into feat/fast-bridge-v2-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiTimesChi committed Sep 17, 2024
2 parents 0f99c3e + 377a7fa commit 0f39b57
Show file tree
Hide file tree
Showing 111 changed files with 2,981 additions and 594 deletions.
2 changes: 1 addition & 1 deletion agents/contracts/bondingmanager/bondingmanager.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/destination/destination.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/gasoracle/gasoracle.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/inbox/inbox.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/lightinbox/lightinbox.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/lightmanager/lightmanager.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/origin/origin.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/summit/summit.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/test/gasdata/gasdataharness.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/test/testclient/testclient.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion agents/contracts/test/tipsharness/tipsharness.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions contrib/opbot/botmd/botmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ import (
"github.com/synapsecns/sanguine/core/dbcommon"
"github.com/synapsecns/sanguine/core/metrics"
"github.com/synapsecns/sanguine/core/metrics/instrumentation/slackertrace"
experimentalLogger "github.com/synapsecns/sanguine/core/metrics/logger"
signerConfig "github.com/synapsecns/sanguine/ethergo/signer/config"
"github.com/synapsecns/sanguine/ethergo/signer/signer"
"github.com/synapsecns/sanguine/ethergo/submitter"
cctpSql "github.com/synapsecns/sanguine/services/cctp-relayer/db/sql"
omnirpcClient "github.com/synapsecns/sanguine/services/omnirpc/client"
"github.com/uptrace/opentelemetry-go-extra/otelzap"
"golang.org/x/sync/errgroup"
)

Expand All @@ -30,15 +32,20 @@ type Bot struct {
signer signer.Signer
submitter submitter.TransactionSubmitter
screener screenerClient.ScreenerClient
logger experimentalLogger.ExperimentalLogger
}

// NewBot creates a new bot server.
func NewBot(handler metrics.Handler, cfg config.Config) *Bot {
server := slacker.NewClient(cfg.SlackBotToken, cfg.SlackAppToken)

sugaredLogger := otelzap.New(experimentalLogger.MakeZapLogger()).Sugar()

Check warning on line 43 in contrib/opbot/botmd/botmd.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/botmd.go#L41-L43

Added lines #L41 - L43 were not covered by tests
bot := Bot{
handler: handler,
cfg: cfg,
server: server,
logger: experimentalLogger.MakeWrappedSugaredLogger(sugaredLogger),

Check warning on line 48 in contrib/opbot/botmd/botmd.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/botmd.go#L48

Added line #L48 was not covered by tests
}

// you should be able to run opbot even without signoz.
Expand Down
18 changes: 12 additions & 6 deletions contrib/opbot/botmd/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func (b *Bot) traceCommand() *slacker.CommandDefinition {
// search for the transaction
res, err := b.signozClient.SearchTraces(ctx.Context(), signoz.Last3Hr, searchMap)
if err != nil {
b.logger.Errorf(ctx.Context(), "error searching for the transaction: %v", err)

Check warning on line 85 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L85

Added line #L85 was not covered by tests
_, err := ctx.Response().Reply("error searching for the transaction")
if err != nil {
log.Println(err)
Expand Down Expand Up @@ -290,6 +291,7 @@ func (b *Bot) rfqRefund() *slacker.CommandDefinition {
}
}
if err != nil {
b.logger.Errorf(ctx.Context(), "error fetching quote request: %v", err)

Check warning on line 294 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L294

Added line #L294 was not covered by tests
_, err := ctx.Response().Reply("error fetching quote request")
if err != nil {
log.Println(err)
Expand Down Expand Up @@ -338,19 +340,23 @@ func (b *Bot) rfqRefund() *slacker.CommandDefinition {
err = retry.WithBackoff(
ctx.Context(),
func(ctx context.Context) error {
txHash, err = relClient.GetTxHashByNonce(ctx, &relapi.GetTxByNonceRequest{
ChainID: rawRequest.OriginChainID,
Nonce: nonce,
})
txHash, err = relClient.GetTxHashByNonce(
ctx,
&relapi.GetTxByNonceRequest{
ChainID: rawRequest.OriginChainID,
Nonce: nonce,
})

Check warning on line 348 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L343-L348

Added lines #L343 - L348 were not covered by tests
if err != nil {
b.logger.Errorf(ctx, "error fetching quote request: %v", err)

Check warning on line 350 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L350

Added line #L350 was not covered by tests
return fmt.Errorf("error fetching quote request: %w", err)
}
return nil
},
retry.WithMaxAttempts(3),
retry.WithMaxAttemptTime(15*time.Second),
retry.WithMaxAttempts(5),
retry.WithMaxAttemptTime(30*time.Second),
)
if err != nil {
b.logger.Errorf(ctx.Context(), "error fetching quote request: %v", err)

Check warning on line 359 in contrib/opbot/botmd/commands.go

View check run for this annotation

Codecov / codecov/patch

contrib/opbot/botmd/commands.go#L359

Added line #L359 was not covered by tests
_, err := ctx.Response().Reply(fmt.Sprintf("error fetching explorer link to refund, but nonce is %d", nonce))
log.Printf("error fetching quote request: %v\n", err)
return
Expand Down
2 changes: 1 addition & 1 deletion contrib/opbot/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ require (
github.com/synapsecns/sanguine/services/cctp-relayer v0.0.0-00010101000000-000000000000
github.com/synapsecns/sanguine/services/omnirpc v0.0.0-00010101000000-000000000000
github.com/synapsecns/sanguine/services/rfq v0.0.0-00010101000000-000000000000
github.com/uptrace/opentelemetry-go-extra/otelzap v0.3.1
github.com/urfave/cli/v2 v2.27.2
golang.org/x/sync v0.8.0
gopkg.in/yaml.v2 v2.4.0
Expand Down Expand Up @@ -240,7 +241,6 @@ require (
github.com/uptrace/opentelemetry-go-extra/otelgorm v0.3.1 // indirect
github.com/uptrace/opentelemetry-go-extra/otelsql v0.3.1 // indirect
github.com/uptrace/opentelemetry-go-extra/otelutil v0.3.1 // indirect
github.com/uptrace/opentelemetry-go-extra/otelzap v0.3.1 // indirect
github.com/valyala/fastjson v1.6.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
Expand Down
2 changes: 1 addition & 1 deletion ethergo/examples/contracttests/counter/counter.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ethergo/parser/abiutil/internal/testsignature.metadata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/rest-api/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["@babel/preset-env", "@babel/preset-typescript"]
}
8 changes: 8 additions & 0 deletions packages/rest-api/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
module.exports = {
extends: '../../.eslintrc.js',
overrides: [
{
files: ['jest.config.js'],
rules: {
'prettier/prettier': 'off',
},
},
],
}
16 changes: 16 additions & 0 deletions packages/rest-api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.0.74](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-09-16)

**Note:** Version bump only for package @synapsecns/rest-api





## [1.0.73](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-09-12)

**Note:** Version bump only for package @synapsecns/rest-api





## [1.0.72](https://github.com/synapsecns/sanguine/compare/@synapsecns/[email protected]...@synapsecns/[email protected]) (2024-09-04)


Expand Down
10 changes: 10 additions & 0 deletions packages/rest-api/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
roots: ['<rootDir>/src'],
transform: {
'^.+\\.(ts|tsx)$': 'babel-jest',
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
moduleDirectories: ['node_modules', 'src'],
}
Loading

0 comments on commit 0f39b57

Please sign in to comment.