Skip to content

Commit 18e404f

Browse files
author
Bengt Lofgren
committed
testing readme added
1 parent bc1b122 commit 18e404f

File tree

1 file changed

+38
-0
lines changed
  • solana/programs/matching-engine/tests

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Matching Engine Tests
2+
3+
## How to read the tests
4+
5+
Each test is found in the `integration_tests.rs` file.
6+
7+
Each test is a function that is annotated with `#[tokio::test]`.
8+
9+
Each test is a test for a specific scenario, and uses the `TestingEngine` to execute a series of instruction triggers.
10+
11+
The `TestingEngine` is initialised with a `TestingContext`. The `TestingContext` holds the solana program test context, the actors, the transfer direction, created vaas, as well as some constants.
12+
13+
The `TestingEngine` is used to execute the instruction triggers in the order they are provided. See the `testing_engine/engine.rs` file for more details.
14+
15+
16+
## Integration Tests
17+
18+
### Initialize program
19+
20+
What is expected:
21+
- Program is initialised
22+
- Router endpoints are created
23+
24+
### Create fast market order
25+
26+
What is expected:
27+
- Fast market order account is created
28+
- Guardian set is created
29+
- Fast market order is initialised
30+
31+
### Close fast market order
32+
33+
What is expected:
34+
- Fast market order account is closed
35+
- Guardian set is closed
36+
- Close account refund recipient is sent usdc
37+
38+

0 commit comments

Comments
 (0)