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

Implement Funding component for IoT State Channels #258

Merged

Conversation

manoranjith
Copy link

Description

Implements funding component for IoT state channels.

Category

Implementation Task

Relevant issue

Closes #251

Testing

Tests for this component has not yet been added. It will be done after implementing #252 and #250.
Until then, all linter checks and existing tests should pass.

Steps to run the tests

Checklist

  • Name is added to the NOTICE file, if it is not present already.
  • Changes are rebased onto the target branch.

Manoranjith added 12 commits July 22, 2023 19:28
- Use the following syntax consistently:
  1. From<type> for funcs that convert from perun to protobuf types.
  2. To<type> for funcs that convert from protobuf types to perun.

Signed-off-by: Manoranjith <[email protected]>
- As these functions are closely coupled to protobuf bindings and do not
  implement any application logic, they fit better in "pb" package.

- Also, move the tests on types in generated go bindings to "pb"
  package.

Signed-off-by: Manoranjith <[email protected]>
- Include all methods defined by the Funder interface.

- Also, update the command for generating protobufs.

Signed-off-by: Manoranjith <[email protected]>
- Because the client initialization itself is not specific to ethereum
  blockchain or payments application.

- Instead, the funder, adjudicator and wallet instances are passed as
  abstract interfaces and it is in the higher layer APIs, the
  functionality is limited to payments.

Signed-off-by: Manoranjith <[email protected]>
- However, only local is supported now.

- Also, add a nolint:funlen directive for session.New function.

Signed-off-by: Manoranjith <[email protected]>
- Common types used across the perun-node project (including errors) are
  defined in perun-node package.

- Hence, these definitions fit better in the perun package.

- Trigger for this change:
  - to implement client side logic for grpc funder (in session package),
    the grpc/pb package is needed, which creates an import cycle.
  - because grpc/pb package imports payments package, which inturn
    imports sessions package.
  - and payment package is importing session package only for using the
    error constants.
  - hence moving these error constants breaks the import cycle by
    removing the need for payments package to import sessions package.

Signed-off-by: Manoranjith <[email protected]>
Signed-off-by: Manoranjith <[email protected]>
@manoranjith manoranjith requested a review from danielksan81 July 24, 2023 06:55
Copy link
Contributor

@danielksan81 danielksan81 left a comment

Choose a reason for hiding this comment

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

lgtm

@manoranjith manoranjith merged commit 6dbcd5b into hyperledger-labs:develop Aug 14, 2023
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

Successfully merging this pull request may close these issues.

[IoT State Channels] Impl remote funder component
2 participants