Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Perbill and other should be decode only valid instance. #5462

@gui1117

Description

@gui1117

Currenctly decoding a 2 billion value doesn't return error

Perbill::decode(encode(2*billion)).unwrap().deconstruct() == 2*billion

I think as the doc state

A fixed point representation of a number between in the range [0, 1].

We must actually return error if value is more than one billion.

(and same for other perthings)

cc @kianenigma

Metadata

Metadata

Assignees

Labels

I3-bugThe node fails to follow expected behavior.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions