-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Move sr-arithmetic to a new crate and add in a fuzzer #3799
Changes from 51 commits
963a14d
0bc870d
b1a9793
dc8cc41
ee26625
38597b9
c7c5888
cd2db5d
8a0ef6b
562cdff
c66f882
7adc99d
c28ae3f
77a8cbb
1fe1a9f
40c0708
c7f5345
20813dd
4aa7dd5
e8cbb1d
ed264e5
f4c5154
85f8487
03dd42e
aeb6a1d
117f818
458edbd
419bc5a
89f6b06
8fb2890
5eb310a
316f562
ac9a2f2
5a21213
99f366e
2123d00
dc651e4
2acc346
38650cf
a377d3e
ae25a41
20a0488
17933d1
7c80be9
c5616c2
c082792
7878cec
5387c96
98cdb31
42f6521
3ac8b87
41cfa3a
99099c9
85a790b
e32f887
883272c
1209939
7202e2d
1cadf86
a934f37
2dd9c31
9a02591
d58d6d3
9dd0688
ab5ec37
dcf169c
f51e484
900c305
79e4348
0a843c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[package] | ||
name = "sr-arithmetic" | ||
version = "2.0.0" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
num-traits = { version = "0.2.8", default-features = false } | ||
serde = { version = "1.0.101", optional = true, features = ["derive"] } | ||
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"] } | ||
rstd = { package = "sr-std", path = "../sr-std", default-features = false } | ||
integer-sqrt = "0.1.2" | ||
|
||
[dev-dependencies] | ||
primitive-types = "0.6.0" | ||
rand = "0.7.2" | ||
|
||
[features] | ||
bench = [] | ||
default = ["std"] | ||
std = [ | ||
"serde", | ||
"num-traits/std", | ||
"rstd/std", | ||
"codec/std", | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
hfuzz_target | ||
hfuzz_workspace |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "sr-arithmetic-fuzzer" | ||
version = "2.0.0" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
honggfuzz = "0.5" | ||
sr-arithmetic = { path = ".." } | ||
primitive-types = "0.6" | ||
num-bigint = { git = "https://github.com/expenses/num-bigint", branch = "as-slice" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is fuzz code, it is okay to depend on git dependencies, but is there any other way to not depend on this branch? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that's not quite ideal, but to compare the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rust-num/num-bigint#12 does what I want, but the repo seems to be moving pretty slowly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. as fuzzer is part of workspace then the test-suite will fail if this branch is changed, I think this is not fine, not sure what the best way to solve this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is used for the function Or you can use the function https://docs.rs/num-bigint/0.2.3/num_bigint/struct.BigUint.html#method.to_radix_be or https://docs.rs/num-bigint/0.2.3/num_bigint/struct.BigUint.html#method.to_radix_le There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you consider this? I suppose you can go to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Converting to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will give this a try, think it is possible to build the thing from str_radix |
||
num-traits = "*" | ||
kianenigma marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
[[bin]] | ||
name = "biguint" | ||
path = "src/biguint.rs" | ||
|
||
[[bin]] | ||
name = "rational128" | ||
path = "src/rational128.rs" |
Uh oh!
There was an error while loading. Please reload this page.