Skip to content

Commit

Permalink
Release 1.1.0 (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
markopoloparadox authored Jun 27, 2022
1 parent da2cab7 commit ba708fc
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 10 deletions.
58 changes: 51 additions & 7 deletions Cargo.lock

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

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

Expand Down Expand Up @@ -78,6 +78,7 @@ 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", default-features = false }

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

# try-runtime = [
Expand Down
1 change: 1 addition & 0 deletions runtime/mainnet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ construct_runtime!(
Bridge: ternoa_bridge = 23,
Multisig: pallet_multisig = 27,
Identity: pallet_identity = 28,
NFT: ternoa_nft = 29,
}
);

Expand Down
20 changes: 19 additions & 1 deletion runtime/mainnet/src/pallets.rs
Original file line number Diff line number Diff line change
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 @@ -595,3 +595,21 @@ impl pallet_identity::Config for Runtime {
type RegistrarOrigin = RootOrAtLeastHalfOfCommittee;
type WeightInfo = pallet_identity::weights::SubstrateWeight<Runtime>;
}

parameter_types! {
pub const InitialMintFee: Balance = 10_000_000_000_000_000_000;
pub const NFTOffchainDataLimit: u32 = 150;
pub const CollectionOffchainDataLimit: u32 = 150;
pub const CollectionSizeLimit: u32 = 1_000_000;
}

impl ternoa_nft::Config for Runtime {
type Event = Event;
type WeightInfo = weights::ternoa_nft::WeightInfo<Runtime>;
type Currency = Balances;
type FeesCollector = Treasury;
type InitialMintFee = InitialMintFee;
type NFTOffchainDataLimit = NFTOffchainDataLimit;
type CollectionOffchainDataLimit = CollectionOffchainDataLimit;
type CollectionSizeLimit = CollectionSizeLimit;
}
2 changes: 1 addition & 1 deletion runtime/mainnet/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: 3,
spec_version: 4,

/// 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/mainnet/src/weights/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ pub mod pallet_timestamp;
pub mod pallet_treasury;
pub mod pallet_utility;
pub mod ternoa_bridge;
pub mod ternoa_nft;
pub mod ternoa_staking_rewards;
108 changes: 108 additions & 0 deletions runtime/mainnet/src/weights/ternoa_nft.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
//! Autogenerated weights for `ternoa_nft`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-06-14, STEPS: `5`, REPEAT: 2, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("alphanet-dev"), DB CACHE: 1024
// Executed Command:
// ./target/release/ternoa
// benchmark
// --chain
// alphanet-dev
// --steps=5
// --repeat=2
// --extrinsic=*
// --execution=wasm
// --wasm-execution=compiled
// --heap-pages=4096
// --output=./weights/
// --pallet=ternoa_nft

#![allow(unused_parens)]
#![allow(unused_imports)]

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

/// Weight functions for `ternoa_nft`.
pub struct WeightInfo<T>(PhantomData<T>);
impl<T: frame_system::Config> ternoa_nft::WeightInfo for WeightInfo<T> {
// Storage: NFT NftMintFee (r:1 w:0)
// Storage: System Account (r:1 w:1)
// Storage: NFT Collections (r:1 w:1)
// Storage: NFT NextNFTId (r:1 w:1)
// Storage: NFT Nfts (r:0 w:1)
fn create_nft(s: u32) -> Weight {
(0 as Weight)
// Standard Error: 9_000
.saturating_add((87_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(4 as Weight))
.saturating_add(T::DbWeight::get().writes(4 as Weight))
}
// Storage: NFT Nfts (r:1 w:1)
// Storage: NFT Collections (r:1 w:1)
fn burn_nft(s: u32) -> Weight {
(0 as Weight)
// Standard Error: 141_000
.saturating_add((280_000 as Weight).saturating_mul(s 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)
fn transfer_nft() -> Weight {
(100_170_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT Nfts (r:1 w:1)
// Storage: NFT DelegatedNFTs (r:0 w:1)
fn delegate_nft() -> Weight {
(56_698_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: NFT Nfts (r:1 w:1)
fn set_royalty() -> Weight {
(71_745_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT NftMintFee (r:0 w:1)
fn set_nft_mint_fee() -> Weight {
(41_820_000 as Weight).saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT NextCollectionId (r:1 w:1)
// Storage: NFT Collections (r:0 w:1)
fn create_collection() -> Weight {
(56_326_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
// Storage: NFT Collections (r:1 w:1)
fn burn_collection() -> Weight {
(64_291_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT Collections (r:1 w:1)
fn close_collection() -> Weight {
(58_941_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT Collections (r:1 w:1)
fn limit_collection() -> Weight {
(56_847_000 as Weight)
.saturating_add(T::DbWeight::get().reads(1 as Weight))
.saturating_add(T::DbWeight::get().writes(1 as Weight))
}
// Storage: NFT Collections (r:1 w:1)
// Storage: NFT Nfts (r:1 w:1)
fn add_nft_to_collection(s: u32) -> Weight {
(0 as Weight)
// Standard Error: 155_000
.saturating_add((483_000 as Weight).saturating_mul(s as Weight))
.saturating_add(T::DbWeight::get().reads(2 as Weight))
.saturating_add(T::DbWeight::get().writes(2 as Weight))
}
}

0 comments on commit ba708fc

Please sign in to comment.