uptest-sc / uptest

"curl" for substrate runtime upgrade testing
7 stars 4 forks source link

Auto input, auto generate input to auto test pallet functionality #77

Closed flipchan closed 11 months ago

flipchan commented 11 months ago

support default types: bool, u32, u64, u128, addresses, f64, u8

Add a rng module to generate random input for the user.

flipchan commented 11 months ago

auto data with rng, also affects issue: https://github.com/uptest-sc/uptest/issues/8

flipchan commented 11 months ago
     Running `target/release/examples/test_input_gen`
u128: 178775027959014874923209709721246590756
u64: 1250344893184879350
u32: 2264555777
f64: 0.9103284860997953
f32: 0.0845471
boolean: false
flipchan commented 11 months ago

u128: 225864167899979897207776191162143802327 u64: 15697195152894034115 u32: 986567393 u8: 247 f64: 0.07036028431640629 f32: 0.48309267 boolean: true

flipchan commented 11 months ago

has rand been audited? is rand secure? Rust security researcher Shnatsel has left several comments on this in this a bit aged issue: https://github.com/rust-secure-code/safety-dance/issues/54

flipchan commented 11 months ago

random accoutid32 with subxt_signer schnorkel wrapper, requires subxthelper flag:

[cfg(feature = "subxthelper")]

pub fn get_address() -> AccountId32 {
flipchan commented 11 months ago

u128: 159537579899660897343412367838632147051 u64: 7429441923015230314 u32: 2608842753 u8: 156 f64: 0.2547209547718835 f32: 0.7272214 boolean: false Address: 5HjAev48u9TC5A3QAyu8WBZuWo4asVx1Z72jNoNcAWzsZpU8