Skip to content

Dummy adapter #53

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

Closed
elpiel opened this issue Jun 4, 2019 · 2 comments
Closed

Dummy adapter #53

elpiel opened this issue Jun 4, 2019 · 2 comments

Comments

@elpiel
Copy link
Member

elpiel commented Jun 4, 2019

As part of the Tracking issue #25 for Adapters we need to create a dummy adapter implementation.
Since we are starting to work on the Validator Workers and this is one of the first things that we are going to need to be used in the Validator Worker and eventually in Sentry.

Create an adapter crate where we are going to define the traits and later we can implement them in a feature for the dummy and use separate adapter-dummy crate for this.

Reference to JS implementation: https://github.com/AdExNetwork/adex-validator/blob/master/adapters/dummy/index.js

This was referenced Jun 4, 2019
@elpiel
Copy link
Member Author

elpiel commented Jun 10, 2019

Currently implemented:

  • sign()
  • verify()
  • getAuthFor

Note: They are Future based! 🎉

To be implemented, once we have the overview what would be the structure:

  • unlock()
  • sessionFromToken
  • getBalanceLeaf
  • getSignableStateRoot
  • MerkleTree

MerkleTree:
I've created a sample repo to test the implementation with https://crates.io/crates/merkletree & https://crates.io/crates/sha3 that can be found here: https://github.com/elpiel/adex-merkle-tree

elpiel added a commit that referenced this issue Jun 10, 2019
* Workspace - add `Adapter` crate

* domain - validator - make `fixtures` module `pub`, instead of `pub(crate)`

* adapter - Cargo.toml - add `domain` to deps and enable `fixtures` feature for dev. dep.

* adapter - lib - start impl SanityChecker & add simple trait Adapter

* adapter - separate SanityChecker, Adapter and add a feature for DummyAdapter

* adapter - Cargo.toml - add the `dummy-adapter` feature

* domain - channel - impl SpecValidators, as we need to handle only a leader and a follower inside

* adapter - sanity - simplify the check if the adapter exists in the channel validators

* Makefile - add `tasks.clippy` to `dev-test-flow` after `rustfmt` for Dev env.

* `Clippy` warnings fix - take `&str` instead of `&String`

* Clippy:
- domina/sentry/adapter - add `deny(clippy::all)`
- adapter - add `deny(rust_2018_idioms)`

* adapter - `Adapter::whoami()` use `&str` instead of `&String`

* domain - channel - fixtures - valid_until should always be in the future

* adapter - Cargo.toml - add `chrono` and `time`

* domain - Asset - derive `PartialEq` & `Eq`

* domain - BigNum - impl `Add` & `Sub`

* adapter - Config and ConfigBuilder

* [+test] adapter - sanity - impl all the validation checks

* [test] adapter - sanity - fix minimum fee test

* domain - validator - fixtures - optional `fee` argument

* [test] adapter - sanity - SanityCheck correct channel validation test

* run `rustfmt`

* adapter - Cargo.toml - add `hex`

* adapter - add `sign` & `verify` + impl dummy `sign` & `verify`

* [+test] adapter - dummy - `sign` & `verify` docs-tests + a unit test

* adapter - Adapter - `get_auth` method:
- Adapter - AdapterError
- dummy - DummyParticipant
- dummy - Dummy - use `HashSet` and store the dummy participants
- dummy - Dummy - use participants for the `get_auth` method

* [+test] adapter - DummyAdapter - fix implementation of `get_auth`

* adapter - DummyAdapter - move the success `get_auth` call to doc-test

* adapter - add doc-test attribute to enable the `dummy-adapter` feature

* adapter - dummy - why does CI fails :(

* adapter - add `futures-preview`

* adapter - enable `async_await` & await_macro` features + add them to the doc-tests as well

* adapter - `sign`, `verify` & `validate_channel` to `Future` based

* adapter - `get_auth` to `Future` based

* Makefile.toml - Use the new env. variable for `clippy` arguments
@elpiel elpiel added this to the 0.2.0 milestone Jun 18, 2019
@elpiel
Copy link
Member Author

elpiel commented Oct 24, 2019

resolved in #143

@elpiel elpiel closed this as completed Oct 24, 2019
@elpiel elpiel modified the milestones: sentry-v0.2.0, validator-v0.2.0 Jan 4, 2021
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