Skip to content

Commit

Permalink
feat: staking for labs and orders enhancement (#311)
Browse files Browse the repository at this point in the history
* feat: enhance lab extrinsic

* fix: formatting

* tests: fix failing genetic analyst unit test

* tests: update lab unit testing

* fix: build errors

* tests: fix failing builds

* feat: update benchmark

* feat: enhance cancel order extrinsic

* feat: weights

* docs: labs pallet
  • Loading branch information
agustinustheo authored Apr 5, 2022
1 parent ae76e47 commit 76fdb7a
Show file tree
Hide file tree
Showing 63 changed files with 4,059 additions and 1,106 deletions.
146 changes: 146 additions & 0 deletions Cargo.lock

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

33 changes: 33 additions & 0 deletions docs/pallets/labs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,37 @@ pub fn sudo_update_admin_key(
origin: OriginFor<T>,
account_id: T::AccountId,
) -> DispatchResultWithPostInfo
```
### Stake Genetic Analysts
```rust
pub fn stake_genetic_analyst(
origin: OriginFor<T>
) -> DispatchResultWithPostInfo
```
### Unstake Genetic Analysts
```rust
pub fn unstake_genetic_analyst(
origin: OriginFor<T>
) -> DispatchResultWithPostInfo
```
### Retrieve Genetic Analysts Unstake Amount
```rust
pub fn retrieve_unstake_amount(
origin: OriginFor<T>,
account_id: T::AccountId,
) -> DispatchResultWithPostInfo
```
### Update Minimum Stake Amount (Admin Only)
```rust
pub fn update_minimum_stake_amount(
origin: OriginFor<T>,
amount: BalanceOf<T>,
) -> DispatchResultWithPostInfo
```
### Update Unstake Duration (Admin Only)
```rust
pub fn update_unstake_time(
origin: OriginFor<T>,
amount: MomentOf<T>,
) -> DispatchResultWithPostInfo
```
16 changes: 8 additions & 8 deletions pallets/certifications/src/weights.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
//! Autogenerated weights for certifications
//!
//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev
//! DATE: 2022-03-28, STEPS: `20`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! DATE: 2022-04-04, STEPS: `20`, REPEAT: 10, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! EXECUTION: Some(Wasm), WASM-EXECUTION: Compiled, CHAIN: Some("dev"), DB CACHE: 128
// Executed Command:
// target/release/debio
// ./target/release/debio
// benchmark
// --chain=dev
// --execution=wasm
Expand Down Expand Up @@ -42,13 +42,13 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Certifications CertificationsCount (r:1 w:1)
// Storage: Certifications Certifications (r:0 w:1)
fn create_certification() -> Weight {
57_064_000_u64
57_605_000_u64
.saturating_add(T::DbWeight::get().reads(3_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
// Storage: Certifications Certifications (r:1 w:1)
fn update_certification() -> Weight {
36_172_000_u64
34_856_000_u64
.saturating_add(T::DbWeight::get().reads(1_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
Expand All @@ -57,7 +57,7 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
// Storage: Certifications CertificationsCount (r:1 w:1)
// Storage: Certifications CertificationsCountByOwner (r:1 w:1)
fn delete_certification() -> Weight {
65_498_000_u64
65_267_000_u64
.saturating_add(T::DbWeight::get().reads(4_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
Expand All @@ -70,13 +70,13 @@ impl WeightInfo for () {
// Storage: Certifications CertificationsCount (r:1 w:1)
// Storage: Certifications Certifications (r:0 w:1)
fn create_certification() -> Weight {
57_064_000_u64
57_605_000_u64
.saturating_add(RocksDbWeight::get().reads(3_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
// Storage: Certifications Certifications (r:1 w:1)
fn update_certification() -> Weight {
36_172_000_u64
34_856_000_u64
.saturating_add(RocksDbWeight::get().reads(1_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
Expand All @@ -85,7 +85,7 @@ impl WeightInfo for () {
// Storage: Certifications CertificationsCount (r:1 w:1)
// Storage: Certifications CertificationsCountByOwner (r:1 w:1)
fn delete_certification() -> Weight {
65_498_000_u64
65_267_000_u64
.saturating_add(RocksDbWeight::get().reads(4_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
Expand Down
Loading

0 comments on commit 76fdb7a

Please sign in to comment.