Bump versions, tweak deposit costs. (#1252)

* Bump versions, tweak deposit costs.

* Version

* Lock

* Make test work ok when numbers are not round.

* Bump Substrate

* Lock
This commit is contained in:
Gavin Wood
2020-06-12 16:08:31 +02:00
committed by GitHub
parent d7e17fc612
commit 4317d1b980
27 changed files with 210 additions and 194 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "westend-runtime"
version = "0.8.7"
version = "0.8.8-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
+11 -5
View File
@@ -24,7 +24,7 @@ pub mod currency {
pub const MILLICENTS: Balance = CENTS / 1_000;
pub const fn deposit(items: u32, bytes: u32) -> Balance {
items as Balance * 15 * CENTS + (bytes as Balance) * 6 * CENTS
items as Balance * 20 * DOLLARS + (bytes as Balance) * 100 * MILLICENTS
}
}
@@ -86,22 +86,28 @@ pub mod fee {
#[cfg(test)]
mod tests {
use frame_support::weights::WeightToFeePolynomial;
use runtime_common::{MaximumBlockWeight, ExtrinsicBaseWeight};
use super::fee::WeightToFee;
use super::currency::{CENTS, DOLLARS};
use frame_support::weights::WeightToFeePolynomial;
use super::currency::{CENTS, DOLLARS, MILLICENTS};
#[test]
// This function tests that the fee for `MaximumBlockWeight` of weight is correct
fn full_block_fee_is_correct() {
// A full block should cost 16 DOLLARS
assert_eq!(WeightToFee::calc(&MaximumBlockWeight::get()), 16 * DOLLARS)
println!("Base: {}", ExtrinsicBaseWeight::get());
let x = WeightToFee::calc(&MaximumBlockWeight::get());
let y = 16 * DOLLARS;
assert!(x.max(y) - x.min(y) < MILLICENTS);
}
#[test]
// This function tests that the fee for `ExtrinsicBaseWeight` of weight is correct
fn extrinsic_base_fee_is_correct() {
// `ExtrinsicBaseWeight` should cost 1/10 of a CENT
assert_eq!(WeightToFee::calc(&ExtrinsicBaseWeight::get()), CENTS / 10)
println!("Base: {}", ExtrinsicBaseWeight::get());
let x = WeightToFee::calc(&ExtrinsicBaseWeight::get());
let y = CENTS / 10;
assert!(x.max(y) - x.min(y) < MILLICENTS);
}
}
+1 -1
View File
@@ -82,7 +82,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("westend"),
impl_name: create_runtime_str!("parity-westend"),
authoring_version: 2,
spec_version: 27,
spec_version: 28,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,