-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1063 add rewards runtime api (#1124)
* fix weightlimit + mocks * attempt to adapt pools integration builder to new version of fudge * Skip e2e / pools for now Lots of compilation errors in the way. Let's comment those out and address everything else first. * Fixing integrations test * rewards: Rename CurrencyId to RewardCurrencyId * rewards: Add tests for list currencies * runtime: Add rewards API * rpc: Add rewards API * deps: Add rewards pallet to runtime-common * scripts: Change log level to info when starting parachain * rewards-api: Rename param and change param order * lint: Obey * rewards-api: Convert result to option * rewards: Revert CurrencyId name change * rewards: Drop turbofish from collect * rewards-test: Drop func that checks user currencies and use assert * rewards: Adjust CurrencyId comment * rewards-test: Add test for associating different currencies * rewards: Return vector when listing currencies * Start testing runtime apis: Setup * integration-test: Add tests for rewards runtime API * nix: Update flake.nix Co-authored-by: Miguel Hervas <[email protected]> Co-authored-by: nuno <[email protected]> Co-authored-by: mustermeiszer <[email protected]>
- Loading branch information
1 parent
bc9b750
commit 2260d6e
Showing
18 changed files
with
504 additions
and
11 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
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
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,30 @@ | ||
// Copyright 2021 Centrifuge Foundation (centrifuge.io). | ||
// | ||
// This file is part of the Centrifuge chain project. | ||
// Centrifuge 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 (see http://www.gnu.org/licenses). | ||
// Centrifuge 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. | ||
|
||
use codec::Codec; | ||
use sp_api::decl_runtime_apis; | ||
use sp_std::vec::Vec; | ||
|
||
decl_runtime_apis! { | ||
/// Runtime API for the rewards pallet. | ||
pub trait RewardsApi<AccountId, Balance, DomainId, CurrencyId> | ||
where | ||
AccountId: Codec, | ||
Balance: Codec, | ||
DomainId: Codec, | ||
CurrencyId: Codec, | ||
{ | ||
fn list_currencies(account_id: AccountId) -> Vec<(DomainId, CurrencyId)>; | ||
|
||
fn compute_reward(currency_id: (DomainId, CurrencyId), account_id: AccountId) -> Option<Balance>; | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -12,4 +12,4 @@ | |
|
||
mod env; | ||
mod pool_starts; | ||
mod utils; | ||
pub mod utils; |
Oops, something went wrong.