Skip to content
Snippets Groups Projects
Commit fd860501 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Make work for no_std (#8402)

parent 28fa5c2b
No related merge requests found
......@@ -15,6 +15,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#![cfg_attr(not(feature = "std"), no_std)]
//! Useful function for inflation for nominated proof of stake.
use sp_arithmetic::{Perquintill, PerThing, biguint::BigUint, traits::{Zero, SaturatedConversion}};
......@@ -72,7 +74,7 @@ pub fn compute_inflation<P: PerThing>(
a.lstrip();
a
};
let mut falloff = BigUint::from(falloff.deconstruct().into());
falloff.lstrip();
......@@ -228,7 +230,7 @@ fn div_by_stripped(mut a: BigUint, b: &BigUint) -> BigUint {
.div_unit(100_000)
.div_unit(100_000)
}
a.div(b, false)
.map(|res| res.0)
.unwrap_or_else(|| BigUint::zero())
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment