Skip to content

Instantly share code, notes, and snippets.

@dexX7
Created November 26, 2014 05:04
Show Gist options
  • Save dexX7/857d08e92d086a2adec6 to your computer and use it in GitHub Desktop.
Save dexX7/857d08e92d086a2adec6 to your computer and use it in GitHub Desktop.
20142611 test_mixed_dex_cancel
~/mastercore/qa/mastercore-rpc-tests$ python test_mixed_dex_cancel.py
...
Start test:
Balance of mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH should be: 63.50000000 SP2 (0.00000000 SP2 reserved)... OK
Balance of mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH should be: 0.00000000 SP2147483655 (0.00000000 SP2147483655 reserved)... OK
Balance of mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH should be: 0 SP2147483651 (0 SP2147483651 reserved)... OK
Offering (action: 1) 0.50000000 SP2 from mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH for 5000000000.00000000 SP2147483651
1. A1 offers 0.5 TMSC for 5000000000 TIndiv1:
Getting balance from mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH for SP2
{'balance': '63.00000000', 'reserved': '0.50000000'}
Traditional DEx orderbook:
[]
Meta DEx orderbook for TMSC:
[{'property_owned': 2, 'ecosystem': 'Test', 'txid': '40477bb9160a150da41eec5a034615c40d15c355f1ec80b54119258a2c7bfc66', 'property_desired': 2147483651, 'blocktime': 1416976559, 'property_desired_divisible': False, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '0.50000000', 'block': 204, 'amount_desired': '5000000000'}]
Meta DEx orderbook for TDiv1:
[]
Meta DEx orderbook for TIndiv1:
[]
Offering (action: 1) 3.00000000 SP2 from mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH for 30.00000000 SP2147483655
2. A1 offers 3.0 TMSC for 30.00000000 TDiv1:
Getting balance from mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH for SP2
{'balance': '60.00000000', 'reserved': '3.50000000'}
Traditional DEx orderbook:
[]
Meta DEx orderbook for TMSC:
[{'property_owned': 2, 'ecosystem': 'Test', 'txid': '40477bb9160a150da41eec5a034615c40d15c355f1ec80b54119258a2c7bfc66', 'property_desired': 2147483651, 'blocktime': 1416976559, 'property_desired_divisible': False, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '0.50000000', 'block': 204, 'amount_desired': '5000000000'}, {'property_owned': 2, 'ecosystem': 'Test', 'txid': '282861ebeb5f37146cf81f94c7a7cf019a97f6cd055630e842cc21c86351e824', 'property_desired': 2147483655, 'blocktime': 1416976562, 'property_desired_divisible': True, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '3.00000000', 'block': 205, 'amount_desired': '30.00000000'}]
Meta DEx orderbook for TDiv1:
[]
Meta DEx orderbook for TIndiv1:
[]
3. A1 offers 10.00000000 TMSC for 0.1 BTC:
Getting balance from mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH for SP2
{'balance': '50.00000000', 'reserved': '13.50000000'}
Traditional DEx orderbook:
[{'amountavailable': '13.50000000', 'accepts': [], 'minimumfee': '0.00010000', 'seller': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'timelimit': 10, 'bitcoindesired': '0.13500000', 'amountaccepted': '0.00000000', 'txid': 'e94a5d8a6113bd4c790610ea2cb3873bc4e9c1779d3c74d144cfd04d48f06cf2', 'unitprice': '0.01000000', 'propertyid': 2}]
Meta DEx orderbook for TMSC:
[{'property_owned': 2, 'ecosystem': 'Test', 'txid': '40477bb9160a150da41eec5a034615c40d15c355f1ec80b54119258a2c7bfc66', 'property_desired': 2147483651, 'blocktime': 1416976559, 'property_desired_divisible': False, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '0.50000000', 'block': 204, 'amount_desired': '5000000000'}, {'property_owned': 2, 'ecosystem': 'Test', 'txid': '282861ebeb5f37146cf81f94c7a7cf019a97f6cd055630e842cc21c86351e824', 'property_desired': 2147483655, 'blocktime': 1416976562, 'property_desired_divisible': True, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '3.00000000', 'block': 205, 'amount_desired': '30.00000000'}]
Meta DEx orderbook for TDiv1:
[]
Meta DEx orderbook for TIndiv1:
[]
4. A1 canceles 10.00000000 TMSC for 0.1 BTC:
Getting balance from mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH for SP2
{'balance': '63.50000000', 'reserved': '0.00000000'}
Traditional DEx orderbook:
[]
Meta DEx orderbook for TMSC:
[{'property_owned': 2, 'ecosystem': 'Test', 'txid': '40477bb9160a150da41eec5a034615c40d15c355f1ec80b54119258a2c7bfc66', 'property_desired': 2147483651, 'blocktime': 1416976559, 'property_desired_divisible': False, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '0.50000000', 'block': 204, 'amount_desired': '5000000000'}, {'property_owned': 2, 'ecosystem': 'Test', 'txid': '282861ebeb5f37146cf81f94c7a7cf019a97f6cd055630e842cc21c86351e824', 'property_desired': 2147483655, 'blocktime': 1416976562, 'property_desired_divisible': True, 'property_owned_divisible': True, 'address': 'mgnNw5c7m69HdZfhhjnCeGkaDgvq2mFGJH', 'action': 1, 'amount_original': '3.00000000', 'block': 205, 'amount_desired': '30.00000000'}]
Meta DEx orderbook for TDiv1:
[]
Meta DEx orderbook for TIndiv1:
[]
Final balance test:
Assertion failed: balance returned by getbalance_MP for SP2: 63.50000000, expected: 60.00000000
Cleaning up
CancelMixedDexTradeTest failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment