Bug in precision handling of value for wallet_transfer of UIA

Started by julian1, December 13, 2014, 10:17:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

vikram

This will be fixed in the next release: https://github.com/BitShares/bitshares/issues/1143

This bug only affected powers of 10 less than 1, and would round them up to the next power of ten.


julian1

Just an update to narrow down the scope,               

A transfer value in a full unit is ok.  Eg.

testwallet (unlocked) >>> wallet_transfer 1 MYUIA test01 xxxxxx '1 xxxxxx'
TIMESTAMP           BLOCK     FROM                TO                  AMOUNT                  MEMO                                        FEE                 ID
======================================================================================================================================================================
2014-12-14T00:40:20 PENDING   test01              xxxxxx              1.0000000 MYUIA        1 xxxxxx                                    0.50000 BTS         8ab1e2a6



While a fractional values < 0 are incorrect,

testwallet (unlocked) >>> wallet_transfer 0.01 MYUIA test01 xxxxxx '0.01 xxxxxx'
TIMESTAMP           BLOCK     FROM                TO                  AMOUNT                  MEMO                                        FEE                 ID     
======================================================================================================================================================================
2014-12-14T00:41:53 PENDING   test01              xxxxxx              0.1000000 MYUIA        0.01 xxxxxx                                 0.50000 BTS         8c6d2ae3



julian1

I transfer 0.01 UIA.  However the transaction records (and sends) a value of 0.1

testwallet (unlocked) >>> wallet_transfer 0.01 MYUIA test01 xxxxxx 'test123'
TIMESTAMP           BLOCK     FROM                TO                  AMOUNT                  MEMO                                        FEE                 ID
======================================================================================================================================================================
2014-12-13T21:43:14 PENDING   test01              xxxxxx              0.1000000 MYUIA         test123                                     0.50000 BTS         b2015456


UIA precision is 10^7

./client.rb bts2  blockchain_get_asset MYUIA | grep precision
  "precision": 10000000,


wallet_get_transaction txid, shows 10^6 sent (should be 10^5),
"trx": {
    "expiration": "2014-12-13T22:43:14",
    "delegate_slate_id": null,
    "operations": [
      {
        "type": "deposit_op_type",
        "data": {
          "amount": 1000000,
          "condition": {
            "asset_id": nnn,



I am running head revision, but *believe* I saw same behavior in a version compiled a couple of weeks ago

./client.rb bts2 about
{
  "blockchain_name": "BitShares",
  "blockchain_description": "The Future of Banking",
  "client_version": "v0.4.26-43-g7960114",
  "bitshares_revision": "796011498ed1a6b4be95de0b79829f55f6d2ff45",
  "bitshares_revision_age": "21 hours ago",
  "fc_revision": "36baae683efaaa16f7eeeba9226820a3b9f13144",
  "fc_revision_age": "46 hours ago",
  "compile_date": "compiled on Dec 13 2014 at 12:18:29",
  "boost_version": "1.55",
  "openssl_version": "OpenSSL 1.0.1f 6 Jan 2014",
  "build": "linux 64-bit"
}

(note, I changed the name of the UIA, to keep details private)