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

x/hashlock package improvements #514

Closed
2 tasks
ruseinov opened this issue Apr 10, 2019 · 3 comments
Closed
2 tasks

x/hashlock package improvements #514

ruseinov opened this issue Apr 10, 2019 · 3 comments

Comments

@ruseinov
Copy link
Contributor

ruseinov commented Apr 10, 2019

  • It would probably help to have some scenario tests for this to provide better overview
  • Not a particular fan of using ctx.Value(contextKeyPreimage) as this seems to be global to the context and using iota (0) in this case. I would much rather prefer a format of extension:variable
@ethanfrey
Copy link
Contributor

ethanfrey commented Apr 23, 2019

Let's just close this as we will delete the package in #540

@ethanfrey
Copy link
Contributor

Not a particular fan of using ctx.Value(contextKeyPreimage) as this seems to be global to the context and using iota (0) in this case. I would much rather prefer a format of extension:variable

This is actually a powerful go trick to make package local keys in context that no other package can read or write. Got this some years ago.

Trick is keys in Context are interface{} which stores type info, and nothing can force a collision with a private type.

@ruseinov
Copy link
Contributor Author

ruseinov commented Apr 25, 2019

ah, I didn't really know this. Cool!

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

2 participants