Simple toy payments engine that reads a series of transactions from a CSV, updates client accounts, handles disputes and chargebacks, and then outputs the state of accounts as a CSV.
git clone [email protected]:lfordyce/leviathan.git
cargo run -- transactions.csv > accounts.csv
- Alternatively run in release mode:
cargo run --release -- transactions.csv >accounts.csv
- When an illegal action occurs, for example a transaction attempting to withdrawal more funds than available, the transaction will not be applied to the account and errors will output to
stderr
. - To capture account balances and errors separately, run the following:
cargo run -- 2> error.log 1> accounts.csv
- Run unit tests
cargo test
- Generic and Modular. Functional design along with the Rust typesystem, Leviathan could be configured to listen on a TCP Stream for transaction events. (currently setup to only read events from a csv file)
- Functional reactive design. Utilizing the Tokio runtime, the Leviathan engine asynchronously streams in transaction events to update an internal account ledger.