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: elcontracts/reader interface to use request-response pattern #494

Open
22 of 40 tasks
damiramirez opened this issue Jan 31, 2025 · 0 comments
Open
22 of 40 tasks

Comments

@damiramirez
Copy link
Contributor

damiramirez commented Jan 31, 2025

Currently, the SDK interfaces are tightly coupled with the underlying contract interfaces. This results in breaking changes whenever contract interfaces are updated, even if the core functionality remains the same. To improve flexibility and maintainability, we should refactor the SDK to adopt a request-response pattern.

Proposed Solution

  • Introduce request structs to encapsulate input parameters.
  • Introduce response structs to encapsulate returned values.
  • Ensure that blockNumber can be set to nil to default to the latest block.
func(r *ChainReader) Foo(
	ctx context.Context,
	blockNumber *big.Int,
	request FooRequest,
) (FooResponse, error) {
	...
}

Updated methods:

@damiramirez damiramirez changed the title refactor: refactor elcontracts/reader interface to use request-response pattern refactor: elcontracts/reader interface to use request-response pattern Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant