-
-
Save ramanathanrv/63c5b129064a7262db9b2c4fa1885e3c to your computer and use it in GitHub Desktop.
Simple Ledger System
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
touch account:s1, type:source, value:1000 | |
touch account:s2, type:sink , value:0 | |
touch account:a1, type:regular | |
issue from:s1, to:a1, value:200, remarks:coins issue | |
touch account:a2, type:regular | |
issue from:a1, to:a2, value:100, remarks:coins issue | |
move from:a1, to:a2, value:10, remarks:a2a transfer for something | |
=> txn: {id:t1, value:10} | |
accounts: {id:a1, balance:190}, {id:a2, balance:110} | |
get account:a1, account:a2 | |
=> accounts: {id:a1, balance:190}, {id:a2, balance:110} | |
copy src:t1, remarks:'repeat a prev txn' | |
=> txn: {id:t2, value:10} | |
accounts: {id:a1, balance:180}, {id:a2, balance:120} | |
reverse src:t1, remarks:'reverse a txn' | |
=> txn: {id:t3, value:10} | |
accounts: {id:a1, balance:190}, {id:a2, balance:110} | |
close account:a2, sink:s2, remarks:'account closure' | |
=> txn: {id:t4, value:110} | |
accounts: {id:a2, balance:0}, {id:s2, balance:110} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment