mirror of
https://github.com/hanzoai/numscript.git
synced 2026-10-30 18:26:57 +00:00
77 lines
1.5 KiB
JSON
77 lines
1.5 KiB
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/formancehq/numscript/main/specs.schema.json",
|
|
"featureFlags": [
|
|
"experimental-asset-scaling"
|
|
],
|
|
"testCases": [
|
|
{
|
|
"it": "allow solution with spare money",
|
|
"balances": {
|
|
"src": {
|
|
"EUR": 100
|
|
}
|
|
},
|
|
"expect.postings": [
|
|
{
|
|
"source": "src",
|
|
"destination": "swap",
|
|
"amount": 1,
|
|
"asset": "EUR"
|
|
},
|
|
{
|
|
"source": "swap",
|
|
"destination": "src",
|
|
"amount": 100,
|
|
"asset": "EUR/2"
|
|
},
|
|
{
|
|
"source": "src",
|
|
"destination": "dest",
|
|
"amount": 2,
|
|
"asset": "EUR/2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"it": "allow solution with spare money (2)",
|
|
"balances": {
|
|
"src": {
|
|
"EUR": 100,
|
|
"EUR/1": 100
|
|
}
|
|
},
|
|
"expect.postings": [
|
|
{
|
|
"source": "src",
|
|
"destination": "swap",
|
|
"amount": 1,
|
|
"asset": "EUR/1"
|
|
},
|
|
{
|
|
"source": "swap",
|
|
"destination": "src",
|
|
"amount": 10,
|
|
"asset": "EUR/2"
|
|
},
|
|
{
|
|
"source": "src",
|
|
"destination": "dest",
|
|
"amount": 2,
|
|
"asset": "EUR/2"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"it": "no solution",
|
|
"balances": {
|
|
"src": {
|
|
"EUR": 0,
|
|
"EUR/2": 1,
|
|
"EUR/3": 1,
|
|
"EUR/4": 10
|
|
}
|
|
},
|
|
"expect.error.missingFunds": true
|
|
}
|
|
]
|
|
} |