blocknetdx / blocknet

Official Blocknet cryptocurrency wallet
https://www.blocknet.org
MIT License
214 stars 95 forks source link

18 decimal places in xbridge #563

Open shrnkld opened 2 years ago

shrnkld commented 2 years ago

Latest QA build: https://gitlab.com/blocknetdx/blocknet/-/pipelines/338714210

shrnkld commented 2 years ago

@corvaxx @vdvoskin

Tested with snode and nodes setup (with XB v57) and build from

See logs extract:

[I] 2021-Sep-08 11:58:11 [0x7f0ef9a0a700] {"orderid":"922f8824dc6266583443e431005c2bacfba2175a877228b22d16b94543d3e3e0","function":"processTransaction","msg":"order rejected, amount from utxo items <4.308934> less than required <4886396799603965952.000000> "} Amount required seems incorrect and orders fail.

To do:

shrnkld commented 2 years ago

Env: Qt build: v4.3.2-f792ce27

QA testing has shown a potential issue with the precision of created orders.

Steps:

Result:

{“orderid”:”ff744d9f64d8444cb0660dbc3be967442e10de211351630f92758813aa618362”,”maker”:”BLOCK”,”maker_size”:”0.100000000000000006”,”maker_addr”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”,”taker”:”LTC”,”taker_size”:”0.001380000000000000”,”taker_addr”:”LVvqBbmQYdi67LZNo6rBZyFWE6bX2Q3FkF”,”partial_allowed”:true,”partial_repost”:true,”partial_minimum”:”0.010000000000000000”,”partial_orig_maker_size”:”0.100000000000000006”,”partial_orig_taker_size”:”0.001380000000000000”,”partial_parent_id”:”0000000000000000000000000000000000000000000000000000000000000000”,”state”:”new”,”block_hash”:”b0029132cd84f3661ff4237ab861c6bc5e441dbde2e94864f5ec8446798881d5”,”updated_at”:”2021-09-22T08:47:44.075Z”,”created_at”:”2021-09-22T08:47:44.075Z”,”err_msg”:””,”cancel_reason”:”crNone”,”utxos”:[{“index”:0,”txid”:”99f06d82d9712cef4c70ff239104e9e53919811eb1e0d73ec2d081b9db002227”,”vout”:0,”amount”:”0.010200000000000001”,”address”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”},{“index”:1,”txid”:”99f06d82d9712cef4c70ff239104e9e53919811eb1e0d73ec2d081b9db002227”,”vout”:1,”amount”:”0.010200000000000001”,”address”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”},{“index”:2,”txid”:”99f06d82d9712cef4c70ff239104e9e53919811eb1e0d73ec2d081b9db002227”,”vout”:2,”amount”:”0.010200000000000001”,”address”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”},{“index”:3,”txid”:”99f06d82d9712cef4c70ff239104e9e53919811eb1e0d73ec2d081b9db002227”,”vout”:3,”amount”:”0.010200000000000001”,”address”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”},{“index”:4,”txid”:”99f06d82d9712cef4c70ff239104e9e53919811eb1e0d73ec2d081b9db002227”,”vout”:4,”amount”:”0.010200000000000001”,”address”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”},{“index”:5,”txid”:”99f06d82d9712cef4c70ff239104e9e53919811eb1e0d73ec2d081b9db002227”,”vout”:5,”amount”:”0.010200000000000001”,”address”:”BoSJWH54yYU5trCfaAtehUMHrfQSmyerW5”},….

_Note the six at the end of the maker_size value._

Expected:

”BLOCK”,”maker_size”:”0.100000000000000000

_Note the zero at the end of the maker_size value._

shrnkld commented 2 years ago

Now confirmed with 'exact' order type too.

dxmakeorder BLOCK 0.1 BpbHPDrJmWJSRVBoLPpLr7VszyebYtQ7Va SYS 0.702 SU4Xyn9p5F2bw3fJrG5kcYMpzTUrFezhLi exact

results in "maker_size": "0.100000000000000006"