mastercoin-MSC / mastercore

mastercore info
mastercoin.org
MIT License
24 stars 11 forks source link

trade_MP - divisible and indivisible amounts #191

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

On a protocol level there are only base units and a simple send of 1 MSC would equal a send of 100000000 units. I'm a bit puzzled about the use of trade_MP and it seems this call is divisibility-aware:

trade_MP n4EmA9R4VmxLnxu9G8yZMDxvBBha8bUtEQ "2" 3 "100000000" 1 1

Trade 2x SP3 for 100000000x SP1

Was what I expected, but:

{
"txid" : "24a887e16571a805fc1be7075814b61042f853eb49636bef0b796e05c19ed1a7",
"sendingaddress" : "n4EmA9R4VmxLnxu9G8yZMDxvBBha8bUtEQ",
"ismine" : true,
"confirmations" : 144,
"fee" : 0.00010000,
"blocktime" : 1414619724,
"type" : "MetaDEx: Offer/Accept one Master Protocol Tokens for another",
"propertyid" : 3,
"divisible" : false,
"amount" : "2",
"property_owned" : 3,
"property_owned_divisible" : false,
"property_desired" : 1,
"property_desired_divisible" : true,
"amount_original" : "0.00000002",
"amount_desired" : "100000000.00000000",
"action" : 3,
"valid" : true
}
  1. How comes it's action 3?
  2. Maybe the amount interpretation and multiplication should simply look for a decimal point. If there is one, it's parsed as divisible amount, if there is none, then it's parsed as indivisible amount. What do you think?

Checks, if this is a legit amount (e.g. by fetching the property), can be performed nevertheless.

Sidenote: UI is broken for me with the current tip and I any click on a button is without effect.