Skip to content

Commit

Permalink
Accept cluster replication props from genesis config (#344)
Browse files Browse the repository at this point in the history
## Description
<!-- Describe what change this PR is implementing -->

## Types of Changes
Please select the branch type you are merging and fill in the relevant
template.
<!--- Check the following box with an x if the following applies: -->
- [ ] Hotfix
- [ ] Release
- [x] Fix or Feature

## Fix or Feature
<!--- Check the following box with an x if the following applies: -->

### Types of Changes
<!--- What types of changes does your code introduce? -->
- [ ] Tech Debt (Code improvements)
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Dependency upgrade (A change in substrate or any 3rd party crate
version)

### Migrations and Hooks
<!--- Check the following box with an x if the following applies: -->
- [ ] This change requires a runtime migration.
- [ ] Modifies `on_initialize`
- [ ] Modifies `on_finalize`

### Checklist for Fix or Feature
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [ ] Change has been tested locally.
- [ ] Change adds / updates tests if applicable.
- [ ] Changelog doc updated.

## Checklist for Hotfix
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [ ] Change has been deployed to Testnet.
- [ ] Change has been tested in Testnet.
- [ ] Changelog has been updated.
- [ ] Crate version has been updated.
- [ ] Spec version has been updated.
- [ ] Transaction version has been updated if required.
- [ ] Pull Request to `dev` has been created.
- [ ] Pull Request to `staging` has been created.

## Checklist for Release
<!--- All boxes need to be checked. Follow this checklist before
requiring PR review -->
- [ ] Change has been deployed to Devnet.
- [ ] Change has been tested in Devnet.
- [ ] Change has been deployed to Qanet.
- [ ] Change has been tested in Qanet.
- [ ] Change has been deployed to Testnet.
- [ ] Change has been tested in Testnet.
- [ ] Changelog has been updated.
- [ ] Crate version has been updated.
- [ ] Spec version has been updated.
- [ ] Transaction version has been updated if required.
  • Loading branch information
khssnv authored May 27, 2024
1 parent d97d5c7 commit 5d85b7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pallets/ddc-clusters-gov/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ lazy_static = { workspace = true, default-features = true }
pallet-balances = { workspace = true, default-features = true }
pallet-contracts = { workspace = true }
pallet-conviction-voting = { workspace = true }
pallet-ddc-clusters = { workspace = true }
pallet-ddc-clusters = { workspace = true, default-features = true }
pallet-ddc-nodes = { workspace = true }
pallet-ddc-staking = { workspace = true }
pallet-insecure-randomness-collective-flip = { workspace = true, default-features = true }
Expand Down
8 changes: 4 additions & 4 deletions pallets/ddc-clusters-gov/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ frame_support::construct_runtime!(
Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>, HoldReason},
Randomness: pallet_insecure_randomness_collective_flip::{Pallet, Storage},
DdcNodes: pallet_ddc_nodes::{Pallet, Call, Storage, Event<T>},
DdcClusters: pallet_ddc_clusters::{Pallet, Call, Storage, Event<T>},
DdcClusters: pallet_ddc_clusters::{Pallet, Call, Storage, Config<T>, Event<T>},
DdcStaking: pallet_ddc_staking::{Pallet, Call, Storage, Event<T>},
Origins: pallet_mock_origins::{Origin},
DdcClustersGov: pallet_ddc_clusters_gov::{Pallet, Call, Storage, Event<T>},
Expand Down Expand Up @@ -265,9 +265,9 @@ impl pallet_ddc_clusters::Config for Test {
type StakerCreator = pallet_ddc_staking::Pallet<Test>;
type Currency = Balances;
type WeightInfo = ();
type MinErasureCodingRequiredLimit = ConstU32<4>;
type MinErasureCodingTotalLimit = ConstU32<6>;
type MinReplicationTotalLimit = ConstU32<3>;
type MinErasureCodingRequiredLimit = ConstU32<0>;
type MinErasureCodingTotalLimit = ConstU32<0>;
type MinReplicationTotalLimit = ConstU32<0>;
}

parameter_types! {
Expand Down
6 changes: 3 additions & 3 deletions pallets/ddc-clusters/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ pub mod pallet {
.props
.node_provider_auth_contract
.clone(),
erasure_coding_required: 4,
erasure_coding_total: 6,
replication_total: 3
erasure_coding_required: cluster.props.erasure_coding_required,
erasure_coding_total: cluster.props.erasure_coding_total,
replication_total: cluster.props.replication_total,
},
self.clusters_protocol_params
.iter()
Expand Down

0 comments on commit 5d85b7a

Please sign in to comment.