Skip to content

Commit

Permalink
Release 1.1.1-rc1 (#220)
Browse files Browse the repository at this point in the history
* add marketplace pallet

* change marketplace weight file

* release/1.1.1-rc1

* only 1/2 for threshold
  • Loading branch information
Leouarz authored Jun 27, 2022
1 parent 022783e commit da2cab7
Show file tree
Hide file tree
Showing 8 changed files with 147 additions and 14 deletions.
35 changes: 27 additions & 8 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions runtime/alphanet/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "alphanet-runtime"
authors = [ "Ternoa" ]
version = "1.1.0"
version = "1.1.1"
edition = "2021"
build = "build.rs"

Expand Down Expand Up @@ -78,7 +78,8 @@ ternoa-runtime-common = { package = "ternoa-runtime-common", path = "../common",
ternoa-mandate = { git = "https://github.com/capsule-corp-ternoa/ternoa-pallets", rev = "v1.0.0", default-features = false }
ternoa-staking-rewards = { git = "https://github.com/capsule-corp-ternoa/ternoa-pallets", rev = "v1.0.0", default-features = false }
ternoa-bridge = { git = "https://github.com/capsule-corp-ternoa/ternoa-pallets", rev = "v1.0.1", default-features = false }
ternoa-nft = { git = "https://github.com/capsule-corp-ternoa/ternoa-pallets", rev = "v1.1.0-rc1", default-features = false }
ternoa-nft = { git = "https://github.com/capsule-corp-ternoa/ternoa-pallets", rev = "v1.1.1-rc1", default-features = false }
ternoa-marketplace = { git = "https://github.com/capsule-corp-ternoa/ternoa-pallets", rev = "v1.1.1-rc1", default-features = false }

[build-dependencies]
substrate-wasm-builder = { git = "https://github.com/capsule-corp-ternoa/substrate", branch = "ternoa-substrate-2022-03-24" }
Expand All @@ -93,6 +94,7 @@ std = [
"ternoa-staking-rewards/std",
"ternoa-bridge/std",
"ternoa-nft/std",
"ternoa-marketplace/std",
# Substrate
"parity-scale-codec/std",
"frame-election-provider-support/std",
Expand Down Expand Up @@ -176,6 +178,7 @@ runtime-benchmarks = [
"pallet-multisig/runtime-benchmarks",
"pallet-identity/runtime-benchmarks",
"ternoa-nft/runtime-benchmarks",
"ternoa-marketplace/runtime-benchmarks",
]

# try-runtime = [
Expand Down
2 changes: 2 additions & 0 deletions runtime/alphanet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ construct_runtime!(
Multisig: pallet_multisig = 27,
Identity: pallet_identity = 28,
NFT: ternoa_nft = 29,
Marketplace: ternoa_marketplace = 30,
}
);

Expand Down Expand Up @@ -451,6 +452,7 @@ mod benches {
[ternoa_staking_rewards, StakingRewards]
[ternoa_bridge, Bridge]
[ternoa_nft, NFT]
[ternoa_marketplace, Marketplace]
// Substrate
[pallet_babe, Babe]
[pallet_bags_list, BagsList]
Expand Down
21 changes: 19 additions & 2 deletions runtime/alphanet/src/pallets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::{
Council, ElectionProviderMultiPhase, Event, Grandpa, Historical, ImOnline, Offences, Origin,
OriginCaller, PalletInfo, Preimage, Runtime, Scheduler, Session, Signature, SignedPayload,
Staking, StakingRewards, System, TechnicalCommittee, Timestamp, TransactionPayment, Treasury,
UncheckedExtrinsic, VERSION,
UncheckedExtrinsic, NFT, VERSION,
};

pub use common::babe::BABE_GENESIS_EPOCH_CONFIG;
Expand Down Expand Up @@ -434,7 +434,7 @@ impl ternoa_mandate::Config for Runtime {
type Event = Event;
type Call = Call;
type ExternalOrigin =
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 2, 3>;
pallet_collective::EnsureProportionAtLeast<AccountId, TechnicalCollective, 1, 2>;
}

// Scheduler
Expand Down Expand Up @@ -613,3 +613,20 @@ impl ternoa_nft::Config for Runtime {
type CollectionOffchainDataLimit = CollectionOffchainDataLimit;
type CollectionSizeLimit = CollectionSizeLimit;
}

parameter_types! {
pub const MarketplaceInitialMintFee: Balance = 1_000_000_000_000_000_000_000;
pub const OffchainDataLimit: u32 = 150;
pub const AccountSizeLimit: u32 = 100_000;
}

impl ternoa_marketplace::Config for Runtime {
type Event = Event;
type WeightInfo = weights::ternoa_marketplace::WeightInfo<Runtime>;
type Currency = Balances;
type FeesCollector = Treasury;
type NFTExt = NFT;
type InitialMintFee = MarketplaceInitialMintFee;
type OffchainDataLimit = OffchainDataLimit;
type AccountSizeLimit = AccountSizeLimit;
}
2 changes: 1 addition & 1 deletion runtime/alphanet/src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
/// Version of the runtime specification. A full-node will not attempt to use its native
/// runtime in substitute for the on-chain Wasm runtime unless all of `spec_name`,
/// `spec_version` and `authoring_version` are the same between Wasm and native.
spec_version: 4,
spec_version: 5,

/// Version of the implementation of the specification. Nodes are free to ignore this; it
/// serves only as an indication that the code is different; as long as the other two versions
Expand Down
1 change: 1 addition & 0 deletions runtime/alphanet/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ pub mod pallet_timestamp;
pub mod pallet_treasury;
pub mod pallet_utility;
pub mod ternoa_bridge;
pub mod ternoa_marketplace;
pub mod ternoa_nft;
pub mod ternoa_staking_rewards;
88 changes: 88 additions & 0 deletions runtime/alphanet/src/weights/ternoa_marketplace.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

//! Autogenerated weights for `ternoa_marketplace`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-06-24, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("alphanet-dev"), DB CACHE: 1024
// Executed Command:
// D:\TernoaCode\chain\target\release\ternoa.exe
// benchmark
// --chain
// alphanet-dev
// --steps=50
// --repeat=20
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./weights/
// --pallet=ternoa_marketplace

#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]

use frame_support::{traits::Get, weights::Weight};
use sp_std::marker::PhantomData;

/// Weight functions for `ternoa_marketplace`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> ternoa_marketplace::WeightInfo for WeightInfo<T> {
// Storage: Marketplace MarketplaceMintFee (r:1 w:0)
// Storage: System Account (r:1 w:1)
// Storage: Marketplace NextMarketplaceId (r:1 w:1)
// Storage: Marketplace Marketplaces (r:0 w:1)
fn create_marketplace() -> Weight {
(47_400_000 as Weight)
.saturating_add(T::DbWeight::get().reads(3 as Weight))
.saturating_add(T::DbWeight::get().writes(3 as Weight))
}
// Storage: Marketplace Marketplaces (r:1 w:1)
fn set_marketplace_owner() -> Weight {
(16_500_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Marketplace Marketplaces (r:1 w:1)
fn set_marketplace_kind() -> Weight {
(16_600_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Marketplace Marketplaces (r:1 w:1)
fn set_marketplace_configuration() -> Weight {
(41_800_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: Marketplace MarketplaceMintFee (r:0 w:1)
fn set_marketplace_mint_fee() -> Weight {
(11_000_000 as Weight)
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT Nfts (r:1 w:1)
// Storage: Marketplace Marketplaces (r:1 w:0)
// Storage: Marketplace ListedNfts (r:0 w:1)
fn list_nft() -> Weight {
(26_300_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: NFT Nfts (r:1 w:1)
// Storage: Marketplace ListedNfts (r:1 w:1)
fn unlist_nft() -> Weight {
(22_000_000 as Weight)
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: NFT Nfts (r:1 w:1)
// Storage: Marketplace ListedNfts (r:1 w:1)
// Storage: Marketplace Marketplaces (r:1 w:0)
// Storage: System Account (r:2 w:2)
fn buy_nft() -> Weight {
(73_500_000 as Weight)
.saturating_add(T::DbWeight::get().reads(5 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
}
5 changes: 4 additions & 1 deletion scripts/benchmarks/alphanet/run_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,7 @@ echo "TERNOA BRIDGE"
echo $(eval $COMMAND --pallet=ternoa_bridge)

echo "TERNOA NFT"
echo $(eval $SHORT_COMMAND --pallet=ternoa_nft)
echo $(eval $SHORT_COMMAND --pallet=ternoa_nft)

echo "TERNOA MARKETPLACE"
echo $(eval $COMMAND --pallet=ternoa_marketplace)

0 comments on commit da2cab7

Please sign in to comment.