We should not do this check because offered_amount and requested_amount can be integers which represent assets with different precisions. We must convert them to a common precision before we can do multiplication or division.
Example:
I create assets A and B, and I want to SELL 5000A for 500B. With current design it is not possible, because:
Current
make_order
has this interface:BalanceOf
here isu128
- an integer.A little bit further in this function this check is executed:
We should not do this check because
offered_amount
andrequested_amount
can be integers which represent assets with different precisions. We must convert them to a common precision before we can do multiplication or division.Example: I create assets A and B, and I want to SELL 5000A for 500B. With current design it is not possible, because:
price would have to be
0.1
, but it has an integer type! So this trade is impossible.The task contains these sub-tasks:
offered_amount
andrequested_amount
make_order
- because user providedoffered_amount
andrequested_amount
.