the path towards stabilizing Substrate
benjamin kampmann
gnunicorn.org // ben@parity.io
Jun 24th, 2020
@Parity & Friends Meetup, Etherlands
merge-order breaking master-branch
🔧
Adding plenty of more Prometheus gauges
github.com/GNUnicorn/cargo-unleash
in a world of github, what even is a 'release'?
– think tokio 0.2 but substrate –
# Cargo.toml [package] name = "suprchain" version = "2.0.0" authors = ["Benjamin Kampmann <ben@parity.io>"] edition = "2018" [dependencies]
suprchain-runtime = "0.2" substrate-client = "0.2"
// main.rs use suprchain_runtime::Runtime; use substrate_node; fn main() { substrate_node::Runner<Runtime>() .main(); }
# Cargo.toml [package] name = "suprchain" version = "2.0.0" authors = ["Benjamin Kampmann <ben@parity.io>"] edition = "2018" [dependencies]
suprchain-runtime = "0.2" substrate-client = { version = "0.2", features = ["unstable-async-offchain"] }
// main.rs use suprchain_runtime::Runtime; use substrate_node; fn main() { substrate_node::Runner<Runtime>() .with_async_offchain(|cfg| { cfg.max_timeout = 360; }) .main(); }
releases indicate stability!
QA happens before the PR is merged
#[test]
fn transfer_smoketest() {
// reuse provided test against local runtime
pallet_balances::tests::transfer_smoke(Runtime.into());
}
// testing a specific feature ourselves
#[test]
fn transfer_should_trigger_event() {
// given
let mut test = test::deterministic(Runtime.into());
// when
test.read_state(|| {
<Runtime as CreateTransaction>::create_transaction(
balance_call,
signer,
account,
nonce,
)
});
// controlled run
test.produce_blocks(1_u32);
// then
test.with_state(|| {
let events = frame_system::Module::<Runtime>::events();
assert_eq!(events.len(), 1);
let events = frame_system::Module::<Runtime>::events();
assert_eq!(events.len(), 1);
});
}
benjamin kampmann
gnunicorn.org // ben@parity.io
Jun 24th, 2020
@Parity & Friends Meetup, Etherlands
In order of appearance: