Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix hard coded return_per_1000 #1015

Open
wants to merge 12 commits into
base: devnet-ready
Choose a base branch
from
3 changes: 2 additions & 1 deletion pallets/subtensor/src/rpc_info/delegate_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ impl<T: Config> Pallet<T> {

let return_per_1000: U64F64 = if total_stake > U64F64::from_num(0) {
emissions_per_day
.saturating_mul(U64F64::from_num(0.82))
.saturating_mul(U64F64::from_num(u16::MAX.saturating_sub(take.0)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use .into() here to be more idiomatic?

.saturating_div(U64F64::from_num(u16::MAX))
.saturating_div(total_stake.saturating_div(U64F64::from_num(1000)))
} else {
U64F64::from_num(0)
Expand Down
Loading