-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dApp staking v3 part 6 * Minor refactor of benchmarks * Weights integration * Fix * remove orig file * Minor refactoring, more benchmark code * Extract on_init logic * Some renaming * More benchmarks * Full benchmarks integration * Testing primitives * staking primitives * dev fix * Integration part1 * Integration part2 * Reward payout integration * Replace lock functionality with freeze * Cleanup TODOs * More negative tests * Frozen balance test * Zero div * Docs for inflation * Rename is_active & add some more docs * More docs * pallet docs * text * scripts * More tests * Test, docs * Review comment * Runtime API * Changes * Change dep * Comment * Formatting * Expired entry cleanup * Cleanup logic test * Remove tier labels * fix * Improve README * Improved cleanup * Review comments * Docs * Formatting * Typo
- Loading branch information
Showing
15 changed files
with
461 additions
and
45 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[package] | ||
name = "dapp-staking-v3-runtime-api" | ||
version = "0.0.1-alpha" | ||
description = "dApp Staking v3 runtime API" | ||
authors.workspace = true | ||
edition.workspace = true | ||
homepage.workspace = true | ||
repository.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
sp-api = { workspace = true } | ||
|
||
astar-primitives = { workspace = true } | ||
pallet-dapp-staking-v3 = { workspace = true } | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"sp-api/std", | ||
"pallet-dapp-staking-v3/std", | ||
"astar-primitives/std", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// This file is part of Astar. | ||
|
||
// Copyright (C) 2019-2023 Stake Technologies Pte.Ltd. | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
// Astar is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
|
||
// Astar is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
|
||
// You should have received a copy of the GNU General Public License | ||
// along with Astar. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
use astar_primitives::BlockNumber; | ||
use pallet_dapp_staking_v3::EraNumber; | ||
|
||
sp_api::decl_runtime_apis! { | ||
|
||
/// dApp Staking Api. | ||
/// | ||
/// Used to provide information otherwise not available via RPC. | ||
pub trait DappStakingApi { | ||
|
||
/// For how many standard era lengths does the voting subperiod last. | ||
fn eras_per_voting_subperiod() -> EraNumber; | ||
|
||
/// How many standard eras are there in the build&earn subperiod. | ||
fn eras_per_build_and_earn_subperiod() -> EraNumber; | ||
|
||
/// How many blocks are there per standard era. | ||
fn blocks_per_era() -> BlockNumber; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.