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

☂️ Beauty fixes #179

Open
2 of 13 tasks
ggwpez opened this issue Sep 6, 2021 · 4 comments
Open
2 of 13 tasks

☂️ Beauty fixes #179

ggwpez opened this issue Sep 6, 2021 · 4 comments
Labels
enhancement Improvement of an existing feature good first issue Good for newcomers help wanted Extra attention is needed umbrella Umbrella issue

Comments

@ggwpez
Copy link
Contributor

ggwpez commented Sep 6, 2021

List of oddities that we noticed in go-perun will be collected here for triage:

  • 1. channel.Nonce is modelled as a *big.Int but describes a []byte which can cause issues with negative number encoding.
  • 2. NewFundingReq returns a *FundingReq (per convention) but Funder.Fund accepts a FundingReq.
  • 3. eth/Backend.VerifySignature contains a superfluous if
  • 4. wallet.Address needs only to be an Encoder, not Serializer. Decoding is handled by the backend anyway. (Done in 193 rename wallettest variable #194)
  • 5. channel/backend.Verify gets passed in Params but expects the implementation to ignore them (Done in Channel.Backend: Remove Params from Sign and Verify #196).
  • 6. Params.ID should be calculated on the fly to avoid inconsistencies. Members of Params are exported, but should be read only (TBD [channel] Params.id may be inconsistent with object properties #188).
  • 7. AdjudicatorReq.Acc and AdjudicatorReq.Idx are not needed for Adjudicator.Register. We could create type RegisterReq specifically for registering.
  • 9. Adjudicator.Withdraw could take the beneficiary as a parameter. (Currently, the beneficiary is a property of the adjudicator.)
  • 10. Add custom errors to the wallet interface: eg. ErrAccountNotFound or ErrWrongAddrType.
  • 11. Add NewAssetFundingError since we also have NewFundingTimeoutError and they need each other.
  • 12. Add NewAdjudicatorReq.
  • WithCommitTx is missing a comment.
  • local/watcher.go contains two wrong usages of Debugf

Please extend this list.
👉 Related issues will be moved to Milestone Beautification.

@ggwpez ggwpez added this to the Beautification milestone Sep 6, 2021
@ggwpez ggwpez added enhancement Improvement of an existing feature good first issue Good for newcomers help wanted Extra attention is needed umbrella Umbrella issue labels Sep 6, 2021
@matthiasgeihs
Copy link
Contributor

matthiasgeihs commented Sep 6, 2021

  • Params.ID should be calculated on the fly to avoid inconsistencies. Members of Params are exported, but should be read only.
  • AdjudicatorReq.Acc and AdjudicatorReq.Idx are not needed for Adjudicator.Register. We could create type RegisterReq specifically for registering.
  • Adjudicator.Withdraw could take the beneficiary as a parameter. (Currently, the beneficiary is a property of the adjudicator.)

@manoranjith
Copy link
Contributor

Do you think we should rename AdjudicatgorSubscription to AdjudicatorSub ?
This would make it more concise and also in line with the name of other type AdjudicatorReq.

@manoranjith
Copy link
Contributor

* `Params.ID` should be calculated on the fly to avoid inconsistencies. Members of `Params` are exported, but should be read only.

* `AdjudicatorReq.Acc` and `AdjudicatorReq.Idx` are not needed for `Adjudicator.Register`. We could create `type RegisterReq` specifically for registering.

* `channel.MakeStateMap` could accept parameter `states ...*State`.

* `Adjudicator.Withdraw` could take the beneficiary as a parameter. (Currently, the beneficiary is a property of the adjudicator.)

+1 Especially on ReqisterReq and beneficiary parameter for Withdraw.

In the watcher task, I currently fill dummy values for Acc and Idx, because I figured out this fields are not used.
Doing otherwise meant, I will have to provide this data to the watcher via a the StartWatching API. Which was unnecessary.

@ggwpez
Copy link
Contributor Author

ggwpez commented Sep 13, 2021

I added the entries to the issue. Feel free to edit the issue next time.

This was referenced Sep 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of an existing feature good first issue Good for newcomers help wanted Extra attention is needed umbrella Umbrella issue
Projects
None yet
Development

No branches or pull requests

3 participants