Skip to content

Commit

Permalink
Fixing e2d and unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgralinski-bright committed Jan 2, 2024
1 parent c8587f2 commit ef0f671
Show file tree
Hide file tree
Showing 22 changed files with 2,903 additions and 770 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
with:
toolchain: 1.69
override: true
- name: Updating submodules
run: git submodule update --init --recursive
- name: Update Rust environment
run: rustup component add rust-src --toolchain 1.69-x86_64-unknown-linux-gnu
- name: Adding WebAssembly target
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ docker build -f docker/Dockerfile.testing --progress=plain .
```

## E2E tests
Currently, we have four major tests for testing different endings of the dispute:
* No majority of votes.
* Verdict against the owner of the dispute.
* Verdict against the defendant of the dispute.
* Testing dispute rounds.

To run E2E tests on your local machine, first run a aleph-node, build and deploy smart contract. We can do it, by running `deploy.sh` script:
```
bash scripts/deploy.sh
Expand All @@ -72,13 +78,13 @@ ink-wrapper -m ../contract/target/ink/bright_disputes.json --wasm-path ../contra

Finally we can run a e2e tests by calling:
```
cargo +nightly test --release
cargo +nightly-2023-04-19 test --release
```

# TODO:
* Store priv keys for jurors and judge in the JSON file and print it on the cmd
* Judge should issue a verdict and point the banned juries...
* Run/Fix all unit test
* Run/Fix all e2e test
* Update documentation + show cases

The output of the e2e test is:
```
test bright_disputes_test::test_dispute_verdict_none ... ok
test bright_disputes_test::test_dispute_verdict_positive ... ok
test bright_disputes_test::test_dispute_verdict_negative ... ok
test bright_disputes_test::test_dispute_rounds ... ok
```
14 changes: 14 additions & 0 deletions cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ edition = "2021"
license = "MIT"
publish = false

[lib]
name = "bright_disputes"
path = "src/lib.rs"

[dependencies]
anyhow = "1.0"
inquire = "0.6.2"
Expand All @@ -22,6 +18,7 @@ tokio = { version = "1.24.2", features = ["rt-multi-thread", "macros"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "env-filter"] }

bright-disputes-lib = { path="lib" }
ark-std = { version = "^0.3.0", default-features = false }
ark-ed-on-bls12-381 = { version = "^0.3.0", features = ["r1cs"] }
ark-serialize = { version = "^0.3.0", default-features = false }
Expand Down
Loading

0 comments on commit ef0f671

Please sign in to comment.