Skip to content

Commit 78f8f70

Browse files
kianenigmagpestana
andauthored
More testing and fuzzing and docs for pools (paritytech#12624)
* move pools fuzzing to hongfuzz * merge more small fixes * fix all tests * Update frame/nomination-pools/fuzzer/src/call.rs Co-authored-by: Gonçalo Pestana <[email protected]> * remove transactional * fmt * fix CI * fmt * fix build again * fix CI Co-authored-by: Gonçalo Pestana <[email protected]>
1 parent abb217d commit 78f8f70

File tree

9 files changed

+562
-436
lines changed

9 files changed

+562
-436
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ members = [
116116
"frame/preimage",
117117
"frame/proxy",
118118
"frame/nomination-pools",
119+
"frame/nomination-pools/fuzzer",
119120
"frame/nomination-pools/benchmarking",
120121
"frame/nomination-pools/test-staking",
121122
"frame/nomination-pools/runtime-api",

frame/balances/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ pub mod pallet {
477477
VestingBalance,
478478
/// Account liquidity restrictions prevent withdrawal
479479
LiquidityRestrictions,
480-
/// Balance too low to send value
480+
/// Balance too low to send value.
481481
InsufficientBalance,
482482
/// Value too low to create account due to existential deposit
483483
ExistentialDeposit,

frame/nomination-pools/Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,17 @@ sp-core = { version = "6.0.0", default-features = false, path = "../../primitive
2626
sp-io = { version = "6.0.0", default-features = false, path = "../../primitives/io" }
2727
log = { version = "0.4.0", default-features = false }
2828

29+
# Optional: usef for testing and/or fuzzing
30+
pallet-balances = { version = "4.0.0-dev", path = "../balances", optional = true }
31+
sp-tracing = { version = "5.0.0", path = "../../primitives/tracing", optional = true }
32+
2933
[dev-dependencies]
3034
pallet-balances = { version = "4.0.0-dev", path = "../balances" }
3135
sp-tracing = { version = "5.0.0", path = "../../primitives/tracing" }
32-
rand = { version = "0.8.5", features = ["small_rng"] }
3336

3437
[features]
3538
default = ["std"]
39+
fuzzing = ["pallet-balances", "sp-tracing"]
3640
std = [
3741
"codec/std",
3842
"scale-info/std",
@@ -51,4 +55,3 @@ runtime-benchmarks = [
5155
try-runtime = [
5256
"frame-support/try-runtime"
5357
]
54-
fuzz-test = []
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[package]
2+
name = "pallet-nomination-pools-fuzzer"
3+
version = "2.0.0"
4+
authors = ["Parity Technologies <[email protected]>"]
5+
edition = "2021"
6+
license = "Apache-2.0"
7+
homepage = "https://substrate.io"
8+
repository = "https://github.com/paritytech/substrate/"
9+
description = "Fuzzer for fixed point arithmetic primitives."
10+
documentation = "https://docs.rs/sp-arithmetic-fuzzer"
11+
publish = false
12+
13+
[package.metadata.docs.rs]
14+
targets = ["x86_64-unknown-linux-gnu"]
15+
16+
[dependencies]
17+
honggfuzz = "0.5.54"
18+
19+
pallet-nomination-pools = { path = "..", features = ["fuzzing"] }
20+
21+
frame-system = { path = "../../system" }
22+
frame-support = { path = "../../support" }
23+
24+
sp-runtime = { path = "../../../primitives/runtime" }
25+
sp-io = { path = "../../../primitives/io" }
26+
sp-tracing = { path = "../../../primitives/tracing" }
27+
28+
rand = { version = "0.8.5", features = ["small_rng"] }
29+
log = "0.4.17"
30+
31+
[[bin]]
32+
name = "call"
33+
path = "src/call.rs"

0 commit comments

Comments
 (0)