Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
vilterp committed Nov 24, 2024
1 parent d42e57d commit a28018c
Showing 1 changed file with 227 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,233 @@ application/json
}
}

addClient{id: "0"}.
signUp{clientID: "0", username: "alice", password: ""}.
addClient{id: "1"}.
signUp{clientID: "1", username: "bob", password: ""}.
runMutation{from: "0", name: "Order", args: [10, 100, "buy"]}.
runMutation{from: "0", name: "Order", args: [10, 100, "buy"]}.
runMutation{from: "0", name: "Order", args: [10, 100, "buy"]}.
runMutation{from: "0", name: "Order", args: [10, 100, "sell"]}.
.jsonState
----
application/json
{
"server": {
"/orders/0.31381383055244927": [
{
"transactionID": "0.00037566525896607457",
"value": {
"id": 0.31381383055244927,
"price": 10,
"amount": 100,
"side": "buy",
"status": "open",
"user": "alice"
}
},
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.31381383055244927,
"price": 10,
"amount": 0,
"status": "sold",
"side": "buy",
"user": "alice"
}
}
],
"/orders/0.015206331866985496": [
{
"transactionID": "0.26905546502122235",
"value": {
"id": 0.015206331866985496,
"price": 10,
"amount": 100,
"side": "buy",
"status": "open",
"user": "alice"
}
},
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.015206331866985496,
"price": 10,
"amount": 0,
"status": "sold",
"side": "buy",
"user": "alice"
}
}
],
"/orders/0.5100409435201818": [
{
"transactionID": "0.5728273955852048",
"value": {
"id": 0.5100409435201818,
"price": 10,
"amount": 100,
"side": "buy",
"status": "open",
"user": "alice"
}
},
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.5100409435201818,
"price": 10,
"amount": 0,
"status": "sold",
"side": "buy",
"user": "alice"
}
}
],
"/orders/0.5855064094862961": [
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.5855064094862961,
"price": 10,
"amount": 100,
"side": "sell",
"status": "open",
"user": "alice"
}
},
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.5855064094862961,
"price": 10,
"amount": 0,
"status": "sold",
"side": "sell",
"user": "alice"
}
},
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.5855064094862961,
"price": 10,
"amount": 0,
"status": "sold",
"side": "sell",
"user": "alice"
}
},
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.5855064094862961,
"price": 10,
"amount": 0,
"status": "sold",
"side": "sell",
"user": "alice"
}
}
],
"/trades/0.6062274799740198": [
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.6062274799740198,
"buyOrder": 0.31381383055244927,
"sellOrder": 0.5855064094862961,
"amount": 100,
"price": 10
}
}
],
"/trades/0.8652590050969823": [
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.8652590050969823,
"buyOrder": 0.015206331866985496,
"sellOrder": 0.5855064094862961,
"amount": 100,
"price": 10
}
}
],
"/trades/0.40809971923762905": [
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.40809971923762905,
"buyOrder": 0.5100409435201818,
"sellOrder": 0.5855064094862961,
"amount": 100,
"price": 10
}
}
]
},
"user0": {},
"client0": {
"/orders/0.31381383055244927": [
{
"transactionID": "0.00037566525896607457",
"value": {
"id": 0.31381383055244927,
"price": 10,
"amount": 100,
"side": "buy",
"status": "open",
"user": "alice"
}
}
],
"/orders/0.015206331866985496": [
{
"transactionID": "0.26905546502122235",
"value": {
"id": 0.015206331866985496,
"price": 10,
"amount": 100,
"side": "buy",
"status": "open",
"user": "alice"
}
}
],
"/orders/0.5100409435201818": [
{
"transactionID": "0.5728273955852048",
"value": {
"id": 0.5100409435201818,
"price": 10,
"amount": 100,
"side": "buy",
"status": "open",
"user": "alice"
}
}
],
"/orders/0.5855064094862961": [
{
"transactionID": "0.2581415779498793",
"value": {
"id": 0.5855064094862961,
"price": 10,
"amount": 100,
"side": "sell",
"status": "open",
"user": "alice"
}
}
]
},
"user1": {},
"client1": {}
}

addClient{id: "0"}.
signUp{clientID: "0", username: "alice", password: ""}.
addClient{id: "1"}.
Expand Down

0 comments on commit a28018c

Please sign in to comment.