Skip to content

Commit 87a5188

Browse files
authored
Issue #99 Applying validators fees (#107)
* domain - big_num - impl AddAssign * domain - DomainError - add a `RuleViolation` * domain - BalancesMap: - Wrap the BTreeMap in our own type - Impl the applying of validation fees * domain - Cargo.toml - add `fake` and `rand` for testing as they are options otherwise * [test] domain - balances_map - apply zero fees * domain - DomainError - add `derive(PartialEq)` * [test] domain - balances_map - test when fees > deposit + clean test code * domain - big_num - impl `Mul<Ratio<BigUint>>` until we impl Integer for BigNum * [test] domain - balances_map - applying fee correctly with partial distribution * domain - Cargo.toml - add `num-traits` & `num-derive` * domain - big_num - use derives and clean code with Ratio * domain - big_num - remove `ratio()` method * domain - big_num - fix bug with `0` after multiplication with `Ratio` * [test] domain - balances_map - applying fees correectly
1 parent a50213a commit 87a5188

File tree

5 files changed

+482
-13
lines changed

5 files changed

+482
-13
lines changed

Cargo.lock

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

domain/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ serde = { version = "^1.0", features = ['derive'] }
1616
serde_json = "1.0"
1717
serde-hex = "0.1.0"
1818
# Domain
19-
num-bigint = { version = "0.2", features = ["serde"] }
2019
chrono = { version = "0.4", features = ["serde"] }
2120
time = "0.1.42"
2221
hex = "0.3.2"
22+
# Numbers - BigNum, Numbers, Traits and Derives
23+
num-bigint = { version = "0.2", features = ["serde"] }
2324
num = "0.2.0"
25+
num-traits = "0.2"
26+
num-derive = "0.2"
2427
# Fixtures
2528
fake = { version = "^1.3", features = ["chrono"], optional = true }
2629
rand = { version = "^0.6", optional = true }
30+
[dev-dependencies]
31+
fake = { version = "^1.3", features = ["chrono"] }
32+
rand = { version = "^0.6" }

0 commit comments

Comments
 (0)