-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #762 from galacticcouncil/feat/lm-bonds-distribution
feat: liquidity mining - use underlying asset's oracle for bonds distribution
- Loading branch information
Showing
11 changed files
with
228 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
mod issue; | ||
pub mod mock; | ||
mod redeem; | ||
#[allow(clippy::module_inception)] | ||
mod tests; |
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,37 @@ | ||
// This file is part of HydraDX. | ||
|
||
// Copyright (C) 2020-2022 Intergalactic, Limited (GIB). | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
use crate::tests::mock::*; | ||
use crate::*; | ||
|
||
#[test] | ||
fn parse_name_should_work() { | ||
let n = Pallet::<Test>::bond_name(0_u32, 1689844300000_u64); | ||
assert_eq!(Pallet::<Test>::parse_bond_name(n), Ok(0_u32)); | ||
|
||
let n = Pallet::<Test>::bond_name(u32::max_value(), 1689844300000_u64); | ||
assert_eq!(Pallet::<Test>::parse_bond_name(n), Ok(u32::max_value())); | ||
|
||
let n = Pallet::<Test>::bond_name(1, 1689844300000_u64); | ||
assert_eq!(Pallet::<Test>::parse_bond_name(n), Ok(1)); | ||
|
||
let n = Pallet::<Test>::bond_name(13_124, 1689844300000_u64); | ||
assert_eq!(Pallet::<Test>::parse_bond_name(n), Ok(13_124)); | ||
|
||
let n = Pallet::<Test>::bond_name(789_970_979, 1689844300000_u64); | ||
assert_eq!(Pallet::<Test>::parse_bond_name(n), Ok(789_970_979)); | ||
} |
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.