mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
New integration tests:
* New tests for autobridging and freeze * Discrepancy detection tests * Don't let Mocha suppress load time errors
This commit is contained in:
committed by
Nik Bougalis
parent
0848e348bb
commit
e14c700c60
114
test/offer-tests-json.js
Normal file
114
test/offer-tests-json.js
Normal file
@@ -0,0 +1,114 @@
|
||||
module.exports = {
|
||||
"Partially crossed completely via bridging": {
|
||||
|
||||
"pre_ledger": {"accounts": {"G1": {"balance": ["1000.0"]},
|
||||
"G2": {"balance": ["1000.0"]},
|
||||
"alice": {"balance": ["500000.0", "200/USD/G1"],
|
||||
"offers": [["100/USD/G1", "88.0"]]},
|
||||
"bob": {"balance": ["500000.0", "500/USD/G2"],
|
||||
"offers": [["88.0", "100/USD/G2"]]},
|
||||
"takerJoe": {"balance": ["500000.0", "500/USD/G1"]}}},
|
||||
|
||||
"offer": ["takerJoe", "500/USD/G2", "500/USD/G1"],
|
||||
|
||||
"post_ledger": {"accounts": {"takerJoe": {"balance": ["400/USD/G1", "100/USD/G2"],
|
||||
"offers": [["400/USD/G2", "400/USD/G1"]]}}}
|
||||
},
|
||||
|
||||
"Partially crossed (halt)": {
|
||||
"pre_ledger": {"accounts": {"G1": {"balance": ["1000.0"]},
|
||||
"G2": {"balance": ["1000.0"]},
|
||||
"alice": {"balance": ["500000.0", "200/USD/G1"],
|
||||
"offers": [["100/USD/G1", "88.0"], ["100/USD/G1", "88.0"]]},
|
||||
//----/ (2) (3) (5) there's no offers left. Halt
|
||||
"bob": {"balance": ["500000.0", "500/USD/G2"],
|
||||
"offers": [["88.0", "100/USD/G2"]]},
|
||||
// (4)
|
||||
"takerJoe": {"balance": ["500000.0", "500/USD/G1"]}}},
|
||||
// (1)
|
||||
"offer": ["takerJoe", "500/USD/G2", "500/USD/G1"],
|
||||
|
||||
// 500,000-88 200+100/USD/G1
|
||||
"post_ledger": {"accounts": {"alice": {"balance": ["499912.0", "300/USD/G1"],
|
||||
"offers": [["100/USD/G1", "88.0"]]},
|
||||
|
||||
"bob": {"balance": ["500088.0", "400/USD/G2"],
|
||||
"offers": [/*["88.0", "100/USD/G2"]*/]},
|
||||
|
||||
"takerJoe": {"balance": ["100/USD/G2", "400/USD/G1"],
|
||||
"offers": [["400/USD/G2", "400/USD/G1"]]}}}
|
||||
},
|
||||
|
||||
"Partially crossed completely via bridging (Sell)": {
|
||||
|
||||
"pre_ledger": {"accounts": {"G1": {"balance": ["1000.0"]},
|
||||
"G2": {"balance": ["1000.0"]},
|
||||
"alice": {"balance": ["500000.0", "200/USD/G1"],
|
||||
"offers": [["200/USD/G1", "176.0", "Sell"]]},
|
||||
"bob": {"balance": ["500000.0", "500/USD/G2"],
|
||||
"offers": [["88.0", "100/USD/G2"]]},
|
||||
"takerJoe": {"balance": ["500000.0", "500/USD/G1"]}}},
|
||||
|
||||
"offer": ["takerJoe", "500/USD/G2", "500/USD/G1", "Sell"],
|
||||
|
||||
"post_ledger": {"accounts": {"alice": {"balance": ["499912.0", "299.9999999999999/USD/G1"],
|
||||
"offers": [["100.0000000000001/USD/G1", "88.0"]]},
|
||||
"takerJoe": {"balance": ["100/USD/G2", "400.0000000000001/USD/G1"],
|
||||
"offers": [["400.0000000000001/USD/G2", "400.0000000000001/USD/G1"]]}}}
|
||||
},
|
||||
|
||||
"Completely crossed via bridging + direct": {
|
||||
|
||||
"pre_ledger": {"accounts": {"G1": {"balance": ["1000.0"]},
|
||||
"G2": {"balance": ["1000.0"]},
|
||||
"alice": {"balance": ["500000.0", "500/USD/G1", "500/USD/G2"],
|
||||
"offers": [["50/USD/G1", "50/USD/G2"],
|
||||
["49/USD/G1", "50/USD/G2"],
|
||||
["48/USD/G1", "50/USD/G2"],
|
||||
["47/USD/G1", "50/USD/G2"],
|
||||
["46/USD/G1", "50/USD/G2"],
|
||||
["45/USD/G1", "50/USD/G2"],
|
||||
["44/USD/G1", "50/USD/G2"],
|
||||
["43/USD/G1", "50/USD/G2"],
|
||||
["100/USD/G1", "88.0"]]},
|
||||
"bob": {"balance": ["500000.0", "500/USD/G2"],
|
||||
"offers": [["88.0", "100/USD/G2"]]},
|
||||
"takerJoe": {"balance": ["500000.0", "600/USD/G1"]}}},
|
||||
|
||||
"offer": ["takerJoe", "500/USD/G2", "500/USD/G1"],
|
||||
|
||||
"post_ledger": {"accounts": {"takerJoe": {"balance": ["500/USD/G2", "128/USD/G1"]}}}
|
||||
},
|
||||
|
||||
"Partially crossed via bridging + direct": {
|
||||
"pre_ledger": {"accounts": {"G1": {"balance": ["1000.0"]},
|
||||
"G2": {"balance": ["1000.0"]},
|
||||
"alice": {"balance": ["500000.0", "500/USD/G1", "500/USD/G2"],
|
||||
"offers": [["372/USD/G1", "400/USD/G2"],
|
||||
["100/USD/G1", "88.0"]]},
|
||||
"bob": {"balance": ["500000.0", "500/USD/G2"],
|
||||
"offers": [["88.0", "100/USD/G2"]]},
|
||||
"takerJoe": {"balance": ["500000.0", "600/USD/G1"]}}},
|
||||
|
||||
"offer": ["takerJoe", "600/USD/G2", "600/USD/G1"],
|
||||
|
||||
"post_ledger": {"accounts": {"takerJoe": {"balance": ["500/USD/G2", "128/USD/G1"],
|
||||
"offers": [["100/USD/G2", "100/USD/G1"]]}}}
|
||||
},
|
||||
|
||||
"Partially crossed via bridging + direct": {
|
||||
"pre_ledger": {"accounts": {"G1": {"balance": ["1000.0"]},
|
||||
"G2": {"balance": ["1000.0"]},
|
||||
"alice": {"balance": ["500000.0", "500/USD/G1", "500/USD/G2"],
|
||||
"offers": [["372/USD/G1", "400/USD/G2"],
|
||||
["100/USD/G1", "88.0"]]},
|
||||
"bob": {"balance": ["500000.0", "500/USD/G2"],
|
||||
"offers": [["88.0", "100/USD/G2"]]},
|
||||
"takerJoe": {"balance": ["500000.0", "600/USD/G1"]}}},
|
||||
|
||||
"offer": ["takerJoe", "600/USD/G2", "600/USD/G1", "Sell"],
|
||||
|
||||
"post_ledger": {"accounts": {"takerJoe": {"balance": ["500/USD/G2", "128/USD/G1"],
|
||||
"offers": [["128/USD/G2", "128/USD/G1"]]}}}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user