Skip to content

Commit

Permalink
Upgrade runtime to 240 (#27)
Browse files Browse the repository at this point in the history
* Upgrade runtime to 240

* remove no need post_upgrade

* remove outdated post_migrate

* fix nft-auction bench

* update pallet weights
  • Loading branch information
sigoden authored Nov 16, 2021
1 parent 8246484 commit 5695305
Show file tree
Hide file tree
Showing 12 changed files with 173 additions and 177 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deer-cli"
version = "0.2.3"
version = "0.2.4"
authors = ["Deer Network"]
description = "Official Rust implementation of the Deer protocol"
build = "build.rs"
Expand Down
2 changes: 1 addition & 1 deletion node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "deer-runtime"
version = "0.2.3"
version = "0.2.4"
edition = "2018"
build = "build.rs"
license = "Apache 2.0"
Expand Down
2 changes: 1 addition & 1 deletion node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 230,
spec_version: 240,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down
2 changes: 1 addition & 1 deletion pallets/nft-auction/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pallet-nft-auction"
version = "0.2.3"
version = "0.2.4"
edition = "2018"
license = "Apache 2.0"

Expand Down
2 changes: 1 addition & 1 deletion pallets/nft-auction/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ benchmarks_instance_pallet! {
T::Currency::make_free_balance_be(&caller, value);
assert_ok!(NFTAuction::<T, I>::bid_english(SystemOrigin::Signed(caller.clone()).into(), auction_id, get_dollars::<T, I>(20)));

System::<T>::set_block_number(T::MinDeadline::get().saturating_add(T::DelayOfAuction::get()).saturating_add(2u32.into()));
System::<T>::set_block_number(expire.saturating_add(T::DelayOfAuction::get()).saturating_add(2u32.into()));

}: _(SystemOrigin::Signed(caller.clone()), auction_id)
verify {
Expand Down
8 changes: 0 additions & 8 deletions pallets/nft-auction/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ pub mod v1 {

#[cfg(feature = "try-runtime")]
pub fn post_migrate<T: Config<I>, I: 'static>() -> Result<(), &'static str> {
assert!(StorageVersion::<T, I>::get() == Releases::V1);
for (_, auction) in DutchAuctions::<T, I>::iter() {
assert!(auction.open_at == auction.created_at);
}
for (_, auction) in EnglishAuctions::<T, I>::iter() {
assert!(auction.open_at == auction.created_at);
}
log!(debug, "migration: nft auction storage version v1 POST migration checks succesful!");
Ok(())
}
}
Loading

0 comments on commit 5695305

Please sign in to comment.