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

refactor(settlement): settlement layer redundent abstraction layer #873

Merged

Conversation

mtsitrin
Copy link
Contributor

  • merged LayerI and HubClient interfaces in the settlement package
    there was almost zero common code for base struct, while it created 2 almost identical intrefaces.
    on the dymension package, with the cosmosClient we had 3(!) interfaces doing basically the same

PR Standards

Opening a pull request should be able to meet the following requirements


Close #629

<-- Briefly describe the content of this pull request -->

For Author:

  • Targeted PR against correct branch
  • included the correct type prefix in the PR title
  • Linked to Github issue with discussion and accepted design
  • Targets only one github issue
  • Wrote unit and integration tests
  • All CI checks have passed
  • Added relevant godoc comments

For Reviewer:

  • confirmed the correct type prefix in the PR title
  • Reviewers assigned
  • confirmed all author checklist items have been addressed

After reviewer approval:

  • In case targets main branch, PR should be squashed and merged.
  • In case PR targets a release branch, PR should be rebased.

@mtsitrin mtsitrin linked an issue May 16, 2024 that may be closed by this pull request
@mtsitrin mtsitrin changed the title Mtsitrin/629 refactor settlement layer redundent abstraction layer refactor(settlement): settlement layer redundent abstraction layer May 16, 2024
@mtsitrin mtsitrin marked this pull request as ready for review May 21, 2024 10:12
@mtsitrin mtsitrin requested a review from a team as a code owner May 21, 2024 10:12
Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

Great change! I think you removed one entire layer of indirection right? Awesome

I suggest a change to make things cleaner and more idiomatic

Please change

  • settlement.LayerI to settlement.Client
  • dymension.LayerClient to dymension.Client
  • grpc.LayerClient to grpc.Client
  • local.LocalClient to local.Client

and change all receiver to c

settlement/dymension/dymension.go Outdated Show resolved Hide resolved
settlement/local/local.go Outdated Show resolved Hide resolved
if err != nil {
return err
}
go d.eventHandler()
go c.eventHandler()

Check notice

Code scanning / CodeQL

Spawning a Go routine Note

Spawning a Go routine may be a possible source of non-determinism
Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

lgtm

@mtsitrin mtsitrin merged commit 4599418 into main May 22, 2024
6 checks passed
@mtsitrin mtsitrin deleted the mtsitrin/629-refactor-settlement-layer-redundent-abstraction-layer branch May 22, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

refactor: Settlement layer redundent abstraction layer
2 participants