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

Reduce code duplication of adding new networks/bridges #1146

Closed
tomusdrw opened this issue Sep 17, 2021 · 1 comment
Closed

Reduce code duplication of adding new networks/bridges #1146

tomusdrw opened this issue Sep 17, 2021 · 1 comment
Labels
A-chores Something that has to be done, as part of regular maintenance
Milestone

Comments

@tomusdrw
Copy link
Contributor

Currently we support ~6 networks / ~3 bridges and the amount of code required to support new pairs seems quite high (see https://github.com/paritytech/parity-bridges-common/pull/1122/files#).

The code looks very similar though, but it uses completely different types without a common trait implementation so it's not easy to extract the generic part. What we would need is "generic modules", but these are obviously not available.

However it's possible to reduce some of the boilerplate by using macros (see select_bridge! in CLI as an example). It would be cool to take a look at what trade-off are we talking about: macro complexity vs code reduction.

@tomusdrw tomusdrw added A-chores Something that has to be done, as part of regular maintenance B-Substrate <> Substrate labels Sep 17, 2021
@tomusdrw tomusdrw added this to the Nice to Have milestone Sep 17, 2021
@svyatonik
Copy link
Contributor

There aren't many lines required now. Bridge declaration is now actually looks like declaration (e.g. here and here). Call builders is the most annoying thing in current declarations - it shall be fixed with #2491 . So I'm closing this issue now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-chores Something that has to be done, as part of regular maintenance
Projects
None yet
Development

No branches or pull requests

2 participants