Skip to content

Commit

Permalink
fix 0.31.7 rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
brentstone committed Feb 28, 2024
1 parent a1b6e43 commit 6bfbb4d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

4 changes: 2 additions & 2 deletions crates/controller/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use namada_core::types::dec::Dec;
use namada_core::types::uint::Uint;
use namada_core::dec::Dec;
use namada_core::uint::Uint;

#[derive(Clone, Debug)]
pub struct PDController {
Expand Down
30 changes: 15 additions & 15 deletions crates/proof_of_stake/src/rewards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::storage::{
write_last_staked_ratio,
};
use crate::token::storage_key::minted_balance_key;
use crate::token::{credit_tokens, inflation};
use crate::token::credit_tokens;
use crate::types::{into_tm_voting_power, BondId, ValidatorState, VoteInfo};
use crate::{
bond_amounts_for_rewards, get_total_consensus_stake, staking_token_address,
Expand Down Expand Up @@ -389,8 +389,8 @@ where

// Write new rewards parameters that will be used for the inflation of
// the current new epoch
let locked_amount = Dec::try_from(locked_amount).into_storage_result()?;
let total_amount = Dec::try_from(total_amount).into_storage_result()?;
let locked_amount = Dec::from(locked_amount);
let total_amount = Dec::from(total_amount);
let locked_ratio = locked_amount / total_amount;

write_last_staked_ratio(storage, locked_ratio)?;
Expand Down Expand Up @@ -645,8 +645,8 @@ mod tests {
Dec::from_str("0.5").unwrap(),
)
.unwrap();
let locked_ratio_0 = Dec::try_from(locked_amount).unwrap()
/ Dec::try_from(total_native_amount).unwrap();
let locked_ratio_0 = Dec::from(locked_amount)
/ Dec::from(total_native_amount);

println!(
"Round 0: Locked ratio: {locked_ratio_0}, inflation: {inflation_0}"
Expand All @@ -673,8 +673,8 @@ mod tests {

// BUG: DIDN'T ADD TO TOTAL AMOUNT

let locked_ratio_1 = Dec::try_from(locked_amount).unwrap()
/ Dec::try_from(total_native_amount).unwrap();
let locked_ratio_1 = Dec::from(locked_amount)
/ Dec::from(total_native_amount);

println!(
"Round 1: Locked ratio: {locked_ratio_1}, inflation: {inflation_1}"
Expand All @@ -701,8 +701,8 @@ mod tests {
)
.unwrap();

let locked_ratio_2 = Dec::try_from(locked_amount).unwrap()
/ Dec::try_from(total_native_amount).unwrap();
let locked_ratio_2 = Dec::from(locked_amount)
/ Dec::from(total_native_amount);
println!(
"Round 2: Locked ratio: {locked_ratio_2}, inflation: {inflation_2}",
);
Expand Down Expand Up @@ -735,8 +735,8 @@ mod tests {
Dec::from_str("0.9").unwrap(),
)
.unwrap();
let locked_ratio_0 = Dec::try_from(locked_amount).unwrap()
/ Dec::try_from(total_native_amount).unwrap();
let locked_ratio_0 = Dec::from(locked_amount)
/ Dec::from(total_native_amount);

println!(
"Round 0: Locked ratio: {locked_ratio_0}, inflation: {inflation_0}"
Expand All @@ -763,8 +763,8 @@ mod tests {

// BUG: DIDN'T ADD TO TOTAL AMOUNT

let locked_ratio_1 = Dec::try_from(locked_amount).unwrap()
/ Dec::try_from(total_native_amount).unwrap();
let locked_ratio_1 = Dec::from(locked_amount)
/ Dec::from(total_native_amount);

println!(
"Round 1: Locked ratio: {locked_ratio_1}, inflation: {inflation_1}"
Expand All @@ -791,8 +791,8 @@ mod tests {
)
.unwrap();

let locked_ratio_2 = Dec::try_from(locked_amount).unwrap()
/ Dec::try_from(total_native_amount).unwrap();
let locked_ratio_2 = Dec::from(locked_amount)
/ Dec::from(total_native_amount);
println!(
"Round 2: Locked ratio: {locked_ratio_2}, inflation: {inflation_2}",
);
Expand Down
3 changes: 0 additions & 3 deletions crates/shielded_token/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ use namada_core::dec::Dec;
use namada_core::uint::Uint;
use namada_parameters as parameters;
use namada_storage::{StorageRead, StorageWrite};
use namada_trans_token::inflation::{
ShieldedRewardsController, ShieldedValsToUpdate,
};
use namada_trans_token::storage_key::{balance_key, minted_balance_key};
use namada_trans_token::{read_denom, Amount, DenominatedAmount, Denomination};

Expand Down
1 change: 0 additions & 1 deletion crates/trans_token/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Transparent token types, storage functions, and validation.
pub mod inflation;
mod storage;
pub mod storage_key;

Expand Down
2 changes: 1 addition & 1 deletion wasm/Cargo.lock

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

2 changes: 1 addition & 1 deletion wasm_for_tests/wasm_source/Cargo.lock

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

0 comments on commit 6bfbb4d

Please sign in to comment.