Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payout 0.9.30 #219

Merged
merged 5 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- [C,D] Updated Substrate to polkadot-v0.9.30
- [C,D] Updated Substrate to polkadot-v0.9.31
rakanalh marked this conversation as resolved.
Show resolved Hide resolved

## [4.7.2]

Expand Down
2 changes: 1 addition & 1 deletion 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 pallets/ddc-clusters/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
codec = { package = "parity-scale-codec", version = "3.1.5", default-features = false, features = ["derive"] }
ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" }
ddc-primitives = { version = "4.8.2", default-features = false, path = "../../primitives" }
ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" }
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
Expand Down
14 changes: 7 additions & 7 deletions pallets/ddc-clusters/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use frame_benchmarking::{
};
use frame_system::RawOrigin;
use pallet_contracts::chain_extension::UncheckedFrom;
use sp_runtime::{AccountId32, Perbill};
use sp_runtime::{AccountId32, Perquintill};
use sp_std::prelude::*;
use testing_utils::*;

Expand All @@ -26,9 +26,9 @@ benchmarks! {
let user = account::<T::AccountId>("user", USER_SEED, 0u32);
let cluster_params = ClusterParams { node_provider_auth_contract: Some(user.clone()) };
let cluster_gov_params: ClusterGovParams<BalanceOf<T>, T::BlockNumber> = ClusterGovParams {
treasury_share: Perbill::default(),
validators_share: Perbill::default(),
cluster_reserve_share: Perbill::default(),
treasury_share: Perquintill::default(),
validators_share: Perquintill::default(),
cluster_reserve_share: Perquintill::default(),
storage_bond_size: 100u32.into(),
storage_chill_delay: 50u32.into(),
storage_unbonding_delay: 50u32.into(),
Expand Down Expand Up @@ -89,9 +89,9 @@ benchmarks! {
let user = account::<T::AccountId>("user", USER_SEED, 0u32);
let _ = config_cluster::<T>(user, cluster_id);
let new_cluster_gov_params: ClusterGovParams<BalanceOf<T>, T::BlockNumber> = ClusterGovParams {
treasury_share: Perbill::default(),
validators_share: Perbill::default(),
cluster_reserve_share: Perbill::default(),
treasury_share: Perquintill::default(),
validators_share: Perquintill::default(),
cluster_reserve_share: Perquintill::default(),
storage_bond_size: 10u32.into(),
storage_chill_delay: 5u32.into(),
storage_unbonding_delay: 5u32.into(),
Expand Down
8 changes: 4 additions & 4 deletions pallets/ddc-clusters/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use sp_runtime::{
traits::{
BlakeTwo256, Convert, Extrinsic as ExtrinsicT, IdentifyAccount, IdentityLookup, Verify,
},
MultiSignature, Perbill,
MultiSignature, Perquintill,
};

use crate::{self as pallet_ddc_clusters, *};
Expand Down Expand Up @@ -244,9 +244,9 @@ impl ExtBuilder {
.assimilate_storage(&mut storage);

let cluster_gov_params = ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down
14 changes: 7 additions & 7 deletions pallets/ddc-clusters/src/testing_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub use frame_benchmarking::{
use frame_system::RawOrigin;
use pallet_contracts::chain_extension::UncheckedFrom;
use pallet_ddc_nodes::Node;
use sp_runtime::Perbill;
use sp_runtime::Perquintill;
use sp_std::prelude::*;

use crate::{Pallet as DdcClusters, *};
Expand All @@ -22,9 +22,9 @@ where
{
let cluster_params = ClusterParams { node_provider_auth_contract: Some(user.clone()) };
let cluster_gov_params: ClusterGovParams<BalanceOf<T>, T::BlockNumber> = ClusterGovParams {
treasury_share: Perbill::default(),
validators_share: Perbill::default(),
cluster_reserve_share: Perbill::default(),
treasury_share: Perquintill::default(),
validators_share: Perquintill::default(),
cluster_reserve_share: Perquintill::default(),
storage_bond_size: 100u32.into(),
storage_chill_delay: 50u32.into(),
storage_unbonding_delay: 50u32.into(),
Expand Down Expand Up @@ -64,9 +64,9 @@ where
};

let cluster_gov_params: ClusterGovParams<BalanceOf<T>, T::BlockNumber> = ClusterGovParams {
treasury_share: Perbill::default(),
validators_share: Perbill::default(),
cluster_reserve_share: Perbill::default(),
treasury_share: Perquintill::default(),
validators_share: Perquintill::default(),
cluster_reserve_share: Perquintill::default(),
storage_bond_size: 100u32.into(),
storage_chill_delay: 50u32.into(),
storage_unbonding_delay: 50u32.into(),
Expand Down
50 changes: 25 additions & 25 deletions pallets/ddc-clusters/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use ddc_traits::cluster::ClusterManager;
use frame_support::{assert_noop, assert_ok, error::BadOrigin};
use frame_system::Config;
use hex_literal::hex;
use sp_runtime::{traits::Hash, Perbill};
use sp_runtime::{traits::Hash, Perquintill};

use super::{mock::*, *};

Expand All @@ -23,9 +23,9 @@ fn create_cluster_works() {
let auth_contract = AccountId::from([3; 32]);

let cluster_gov_params = ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down Expand Up @@ -154,9 +154,9 @@ fn add_and_delete_node_works() {
cluster_reserve_id.clone(),
ClusterParams { node_provider_auth_contract: Some(cluster_manager_id.clone()) },
ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down Expand Up @@ -374,9 +374,9 @@ fn set_cluster_params_works() {
cluster_reserve_id.clone(),
ClusterParams { node_provider_auth_contract: Some(auth_contract_1) },
ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down Expand Up @@ -422,9 +422,9 @@ fn set_cluster_gov_params_works() {
let auth_contract = AccountId::from([3; 32]);

let cluster_gov_params = ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down Expand Up @@ -463,9 +463,9 @@ fn set_cluster_gov_params_works() {
);

let updated_gov_params = ClusterGovParams {
treasury_share: Perbill::from_float(0.06),
validators_share: Perbill::from_float(0.02),
cluster_reserve_share: Perbill::from_float(0.03),
treasury_share: Perquintill::from_float(0.06),
validators_share: Perquintill::from_float(0.02),
cluster_reserve_share: Perquintill::from_float(0.03),
storage_bond_size: 1000,
storage_chill_delay: 500,
storage_unbonding_delay: 500,
Expand Down Expand Up @@ -537,9 +537,9 @@ fn cluster_visitor_works() {
let auth_contract = AccountId::from([3; 32]);

let cluster_gov_params = ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down Expand Up @@ -585,9 +585,9 @@ fn cluster_visitor_works() {
assert_eq!(
<DdcClusters as ClusterVisitor<Test>>::get_fees_params(&cluster_id).unwrap(),
ClusterFeesParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02)
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02)
}
);

Expand Down Expand Up @@ -646,9 +646,9 @@ fn cluster_creator_works() {
let auth_contract = AccountId::from([3; 32]);

let cluster_gov_params = ClusterGovParams {
treasury_share: Perbill::from_float(0.05),
validators_share: Perbill::from_float(0.01),
cluster_reserve_share: Perbill::from_float(0.02),
treasury_share: Perquintill::from_float(0.05),
validators_share: Perquintill::from_float(0.01),
cluster_reserve_share: Perquintill::from_float(0.02),
storage_bond_size: 100,
storage_chill_delay: 50,
storage_unbonding_delay: 50,
Expand Down
3 changes: 2 additions & 1 deletion pallets/ddc-customers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition = "2021"
frame-benchmarking = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31", optional = true }
frame-support = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
frame-system = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }
sp-std = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.31" }

Expand All @@ -17,7 +18,7 @@ rand_chacha = { version = "0.2", default-features = false, optional = true }
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] }

# Cere
ddc-primitives = { version = "0.1.0", default-features = false, path = "../../primitives" }
ddc-primitives = { version = "4.8.2", default-features = false, path = "../../primitives" }
ddc-traits = { version = "0.1.0", default-features = false, path = "../../traits" }
rakanalh marked this conversation as resolved.
Show resolved Hide resolved

[dev-dependencies]
Expand Down
9 changes: 4 additions & 5 deletions pallets/ddc-customers/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use ddc_primitives::{ClusterGovParams, ClusterId, ClusterParams};
use frame_benchmarking::{account, benchmarks, whitelist_account};
use frame_support::traits::Currency;
use sp_runtime::Perbill;
use sp_runtime::Perquintill;
use sp_std::prelude::*;

use super::*;
Expand All @@ -21,11 +21,10 @@ benchmarks! {
create_bucket {
let cluster_id = ClusterId::from([1; 20]);
let user = account::<T::AccountId>("user", USER_SEED, 0u32);

let cluster_gov_params: ClusterGovParams<BalanceOf<T>, T::BlockNumber> = ClusterGovParams {
treasury_share: Perbill::default(),
validators_share: Perbill::default(),
cluster_reserve_share: Perbill::default(),
treasury_share: Perquintill::default(),
validators_share: Perquintill::default(),
cluster_reserve_share: Perquintill::default(),
storage_bond_size: 100u32.into(),
storage_chill_delay: 50u32.into(),
storage_unbonding_delay: 50u32.into(),
Expand Down
Loading
Loading