Skip to content
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

Use Iota Types for sinner contract_type #1498

Merged
merged 1 commit into from
Oct 25, 2023
Merged

Conversation

trajan0x
Copy link
Contributor

@trajan0x trajan0x commented Oct 25, 2023

Description

See title

Summary by CodeRabbit

  • Refactor: Enhanced the flexibility and maintainability of the ContractType enum in the Sinner service. The update introduces a more dynamic way of handling ContractType values, reducing the risk of errors and making the code easier to update in the future. This change is internal and does not directly affect the user interface or functionality, but it contributes to the overall reliability of the system.

@trajan0x trajan0x requested a review from nautsimon October 25, 2023 13:18
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 25, 2023

Walkthrough

The changes introduce a code generation directive for the ContractType enum, enhancing maintainability by automating stringer methods generation. The ContractTypeFromString function is also updated to leverage these generated string representations, improving code consistency.

Changes

File Summary
.../config/indexer/config.go Introduced go:generate directive for ContractType enum. Updated ContractTypeFromString function to use generated string representations.
.../config/indexer/contracttype_string.go Updated code generation command for ContractType enum. Adjusted _ContractType_name and _ContractType_index variables to match new generated code.

🐇
"In the land of code, where logic is king,
Changes are made, improvements they bring.
Enums now string, with a generation swing,
Celebrate the joy, let the code sing! 🎵"


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.json

@github-actions github-actions bot added go Pull requests that update Go code size/xs labels Oct 25, 2023
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (4f0ef6c) 50.97978% compared to head (589d574) 50.90552%.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           feat/sinner       #1498         +/-   ##
=====================================================
- Coverage     50.97978%   50.90552%   -0.07426%     
=====================================================
  Files              369         369                 
  Lines            25465       25455         -10     
  Branches           268         268                 
=====================================================
- Hits             12982       12958         -24     
- Misses           11215       11222          +7     
- Partials          1268        1275          +7     
Flag Coverage Δ
cctp-relayer 63.33333% <ø> (-1.05692%) ⬇️
core 57.94739% <ø> (ø)
ethergo 60.80880% <ø> (-0.16773%) ⬇️
explorer 25.43225% <ø> (ø)
git-changes-action 53.94265% <ø> (ø)
omnirpc 53.19635% <ø> (ø)
promexporter 41.02564% <ø> (ø)
release-copier-action 19.33333% <ø> (ø)
scribe 52.21130% <ø> (ø)
sinner 11.11111% <ø> (ø)
tools 21.72452% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@trajan0x trajan0x mentioned this pull request Oct 25, 2023
@trajan0x trajan0x marked this pull request as ready for review October 25, 2023 13:49
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 4f0ef6c and 589d574.
Files selected for processing (2)
  • services/sinner/config/indexer/config.go (1 hunks)
  • services/sinner/config/indexer/contracttype_string.go (2 hunks)
Files skipped from review due to trivial changes (2)
  • services/sinner/config/indexer/config.go
  • services/sinner/config/indexer/contracttype_string.go

@nautsimon nautsimon merged commit a5a0960 into feat/sinner Oct 25, 2023
38 checks passed
@nautsimon nautsimon deleted the fix/sinner-string branch October 25, 2023 16:14
nautsimon added a commit that referenced this pull request Nov 2, 2023
* init

* stashing at prev checkpoint to resolve build issues

* updating graphql

* live filling updates

* stash prev changes before tests

* update queries w/tests

* update api and cli

* stash before deploy

* api tests

* lint

* lint

* lint + gen

* code cov

* gen

* adding code cov

* lint + test + coderabbit suggestions

* symlink

* edits

* hold

* Update go.mod

* sinner docker + main.go

* sinner test flake, bytes -> hex string update, update assert use, lint

* update logging

* deprecate port flag

* updating fetch ceil

* adding concurrency during parse store

* add comments

* gen (stringer)

* add build to .goreleaser.yml

* build

* Revert "build" [goreleaser]

This reverts commit 8c61076.

* fix goreleaser [goreleaser]

* fix replacement issue

* [sinner] add start readme (#1499)

* add start readme

* fix https://github.com/synapsecns/sanguine/pull/1380/files#r1371810612

---------

Co-authored-by: Trajan0x <[email protected]>

* sinner strings for contract_type (#1498)

Co-authored-by: Trajan0x <[email protected]>

* trajan edits

* nits

* explorer update

* Sinner: resolvers and updating db read functions (#1514)

* init staging

* add more db read functions

* update model to where

* update filters

* hash

* Revert "hash"

This reverts commit 9b159df.

* remove unused db mocks

* handle invalid port

---------

Co-authored-by: Trajan0x <[email protected]>

* type fix

* simplify w generics

* add go error group to unified command + updated read.go

* code rabbit nit

* logger fix

* Parser, API, and config updates

* tests, sinner/indexer updates, db updates

* lint + refactor graphql + db

* Add log range asc to API

* [goreleaser]

* Update README.md

* refactor indexer

* exit 1 on fail

* update scribe fetcher and pagination behavior

* mysql context

* mysql + refresh rate

* update config and readme + [goreleaser]

* update tests

* typo + [goreleaser]

* prom exporter gen

* revert abi - [goreleaser]

* [goreleaser]

* specify varchar length for indexing [goreleaser]

* update 64 to 66 to account for 0x [goreleaser]

* update api

* [goreleaser]

* gen

* update comment

* [goreleaser]

* add asc flag

* [goroutine]

* [goreleaser]

---------

Co-authored-by: Trajan0x <[email protected]>
Co-authored-by: trajan0x <[email protected]>
nautsimon added a commit that referenced this pull request Nov 4, 2023
* init

* stashing at prev checkpoint to resolve build issues

* updating graphql

* live filling updates

* stash prev changes before tests

* update queries w/tests

* update api and cli

* stash before deploy

* api tests

* lint

* lint

* lint + gen

* code cov

* gen

* adding code cov

* lint + test + coderabbit suggestions

* symlink

* edits

* hold

* Update go.mod

* sinner docker + main.go

* sinner test flake, bytes -> hex string update, update assert use, lint

* update logging

* deprecate port flag

* updating fetch ceil

* adding concurrency during parse store

* add comments

* gen (stringer)

* add build to .goreleaser.yml

* build

* Revert "build" [goreleaser]

This reverts commit 8c61076.

* fix goreleaser [goreleaser]

* fix replacement issue

* [sinner] add start readme (#1499)

* add start readme

* fix https://github.com/synapsecns/sanguine/pull/1380/files#r1371810612

---------

Co-authored-by: Trajan0x <[email protected]>

* sinner strings for contract_type (#1498)

Co-authored-by: Trajan0x <[email protected]>

* trajan edits

* nits

* explorer update

* Sinner: resolvers and updating db read functions (#1514)

* init staging

* add more db read functions

* update model to where

* update filters

* hash

* Revert "hash"

This reverts commit 9b159df.

* remove unused db mocks

* handle invalid port

---------

Co-authored-by: Trajan0x <[email protected]>

* type fix

* simplify w generics

* add go error group to unified command + updated read.go

* code rabbit nit

* logger fix

* Parser, API, and config updates

* tests, sinner/indexer updates, db updates

* lint + refactor graphql + db

* Add log range asc to API

* [goreleaser]

* Update README.md

* refactor indexer

* exit 1 on fail

* update scribe fetcher and pagination behavior

* mysql context

* mysql + refresh rate

* update config and readme + [goreleaser]

* init

* mod lint

* omnirpc version bump

* chart bump

* Update values.yaml

* lint

* rm omnirpc dependacy

* update op rpc (ratelimited)

* rev

---------

Co-authored-by: Trajan0x <[email protected]>
Co-authored-by: trajan0x <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go Pull requests that update Go code size/xs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants