mastercoin-MSC / mastercore

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

Latest changes for reserving amounts is faulty #230

Closed dexX7 closed 9 years ago

dexX7 commented 9 years ago

I was testing an updated PR for "cancel-everything", but noticed a lot of tests fail which actually should pass. Then I run another round based on https://github.com/mastercoin-MSC/mastercore/commit/0a2acbeb0a1c287b5842f5674b20d786f27f0c2d. The results were similar.

I only have the test log right now (on a slow notebook, running everything in a VM is a pain ... ;) and unfortunally no debug log: https://gist.githubusercontent.com/dexX7/5e8dffd8bed6a96ca32e/raw/

Test summary:

ExodusPurchaseTest ... successful
PropertyCreationTest ... successful
P2SHTest ... successful
MetaDexPlanTest ... failed
MetaDexCancelAtPriceTest ... failed
MetaDexCancelPairAndLookupTest ... failed
MetaDexCancelEverythingInSameEcosystemTest ... failed
MetaDexCancelEverythingIgnorePropertyTest ... failed
MetaDexCancelEverythingScopeTest ... failed
DexCrossEcosystemSideEffectsTest ... failed
TraditionalDexTest ... successful

4 of 11 tests successful

Some of those tests are expected to fail without full support for "cancel-everything", but it appears as if it breaks with the very first meta DEx trade: test_meta_dex_plan.py#L622-L636

The sequence is basically:

1) A1 starts with 150.0 TMSC, 100.0 TDiv1 and TIndiv1
2) A1 offers 10.0 TDiv1 for 10.0 TMSC

A1 should have 150.0 TMSC (0.0 TMSC reserved) ... OK
A1 should have 90.0 TDiv1 (10.0 TDiv1 reserved) ... FAIL
A1 appears to have 90.0 TDiv1 and 0.0 TDiv1 reserved

I'll provide further information later, if needed.

dexX7 commented 9 years ago

Debug entry of this specific trade:

____________________________________________________________________________________________________________________________________
2014-12-09 18:12:29 parseTransaction(block=204, 2014-12-09 18:12:29 idx= 1); txid: 89a08b2a02eafa903b15693bfd3a7d2b0a8cf3133ef342a9b96a9b7fa9645eff
2014-12-09 18:12:29 version: 0, Class B
2014-12-09 18:12:29                 type: 21 (MetaDEx token trade)
2014-12-09 18:12:29             property: 2147483655 (Test token: 7 : 0x80000007)
2014-12-09 18:12:29                value: 10.00000000
2014-12-09 18:12:29     desired property: 2 (TMSC)
2014-12-09 18:12:29        desired value: 10.00000000
2014-12-09 18:12:29               action: 1
2014-12-09 18:12:29 MetaDEx_ADD(); buyer obj: 1.00000000000000000000000000000000000000000000000000:mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G in 204/001, txid: 89a08b2a02 , trade #2147483655 10.00000000 for #2 10.00000000
2014-12-09 18:12:29 x_Trade(mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G: prop=2147483655, desprop=2, desprice= 1.00000000000000000000000000000000000000000000000000);newo: 1.00000000000000000000000000000000000000000000000000:mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G in 204/001, txid: 89a08b2a02 , trade #2147483655 10.00000000 for #2 10.00000000
2014-12-09 18:12:29 x_Trade()=0:NOTHING NOT FOUND ON THE MARKET
2014-12-09 18:12:29 update_tally_map(mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G, 2147483655=0x80000007, -1000000000, ttype=0); before=10000000000, after=9000000000
2014-12-09 18:12:29 update_tally_map(mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G, 2147483655=0x80000007, +1000000000, ttype=4); before=0, after=1000000000
2014-12-09 18:12:29 PRICE CHECK Insert: buyer = 1.00000000000000000000000000000000000000000000000000 , inserted = 1.00000000000000000000000000000000000000000000000000 : good
2014-12-09 18:12:29 ==== INSERTED: 1.00000000000000000000000000000000000000000000000000= 1.00000000000000000000000000000000000000000000000000:mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G in 204/001, txid: 89a08b2a02 , trade #2147483655 10.00000000 for #2 10.00000000
2014-12-09 18:12:29 BLOCK: 204 =txid: 89a08b2a02eafa903b15693bfd3a7d2b0a8cf3133ef342a9b96a9b7fa9645eff =fee: 0.00010000
2014-12-09 18:12:29 sender: mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G ; receiver: mj6hNfqLSvjaEUzw3HyD8D7JtA8r5d5L7G
2014-12-09 18:12:29 pkt: 0000001580000007000000003b9aca0000000002000000003b9aca000100
2014-12-09 18:12:29 recordTX(89a08b2a02eafa903b15693bfd3a7d2b0a8cf3133ef342a9b96a9b7fa9645eff, valid=YES, block= 204, type= 21, value= 1000000000)
dexX7 commented 9 years ago

Should be resolved by #233. Note @zathras-crypto: I didn't touch the GUI layer, so this may still be an issue there.