diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index 6c19aa3..c24c4b1 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -69,13 +69,11 @@ func main() { var resourceDir string var size uint var engineDebug bool - var stateDebug bool var host string var port uint flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") - flag.BoolVar(&engineDebug, "engine-debug", false, "use engine debug output") - flag.BoolVar(&stateDebug, "state-debug", false, "use engine debug output") + flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", "127.0.0.1", "http host") flag.UintVar(&port, "p", 7123, "http port") @@ -91,9 +89,7 @@ func main() { OutputSize: uint32(size), FlagCount: uint32(16), } - if stateDebug { - cfg.StateDebug = true - } + if engineDebug { cfg.EngineDebug = true } diff --git a/cmd/async/main.go b/cmd/async/main.go index b936538..09236fd 100644 --- a/cmd/async/main.go +++ b/cmd/async/main.go @@ -41,14 +41,12 @@ func main() { var resourceDir string var size uint var engineDebug bool - var stateDebug bool var host string var port uint flag.StringVar(&sessionId, "session-id", "075xx2123", "session id") flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") - flag.BoolVar(&engineDebug, "engine-debug", false, "use engine debug output") - flag.BoolVar(&stateDebug, "state-debug", false, "use engine debug output") + flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", "127.0.0.1", "http host") flag.UintVar(&port, "p", 7123, "http port") @@ -64,9 +62,7 @@ func main() { OutputSize: uint32(size), FlagCount: uint32(16), } - if stateDebug { - cfg.StateDebug = true - } + if engineDebug { cfg.EngineDebug = true } diff --git a/cmd/http/main.go b/cmd/http/main.go index 9c24a55..6b868ed 100644 --- a/cmd/http/main.go +++ b/cmd/http/main.go @@ -30,13 +30,11 @@ func main() { var resourceDir string var size uint var engineDebug bool - var stateDebug bool var host string var port uint flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") - flag.BoolVar(&engineDebug, "engine-debug", false, "use engine debug output") - flag.BoolVar(&stateDebug, "state-debug", false, "use engine debug output") + flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", "127.0.0.1", "http host") flag.UintVar(&port, "p", 7123, "http port") @@ -52,9 +50,7 @@ func main() { OutputSize: uint32(size), FlagCount: uint32(16), } - if stateDebug { - cfg.StateDebug = true - } + if engineDebug { cfg.EngineDebug = true } diff --git a/cmd/main.go b/cmd/main.go index bd3d634..9db5e0a 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -23,10 +23,10 @@ func main() { var dbDir string var size uint var sessionId string - var debug bool + var engineDebug bool flag.StringVar(&sessionId, "session-id", "075xx2123", "session id") flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") - flag.BoolVar(&debug, "d", false, "use engine debug output") + flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.Parse() @@ -93,7 +93,7 @@ func main() { en := lhs.GetEngine() en = en.WithFirst(hl.Init) - if debug { + if engineDebug { en = en.WithDebug(nil) } diff --git a/services/registration/amount.vis b/services/registration/amount.vis index 9b2970a..b491fab 100644 --- a/services/registration/amount.vis +++ b/services/registration/amount.vis @@ -9,4 +9,5 @@ CATCH invalid_amount flag_invalid_amount 1 INCMP _ 0 LOAD get_recipient 12 LOAD get_sender 64 +LOAD get_amount 12 INCMP transaction_pin * diff --git a/services/registration/transaction_initiated.vis b/services/registration/transaction_initiated.vis index 3b8b9f6..f8cf19c 100644 --- a/services/registration/transaction_initiated.vis +++ b/services/registration/transaction_initiated.vis @@ -1,7 +1,7 @@ LOAD reset_incorrect 6 CATCH incorrect_pin flag_incorrect_pin 1 CATCH _ flag_account_authorized 0 -LOAD get_amount 10 +RELOAD get_amount MAP get_amount RELOAD get_recipient MAP get_recipient diff --git a/services/registration/transaction_pin b/services/registration/transaction_pin index 7b6bddb..a1b7125 100644 --- a/services/registration/transaction_pin +++ b/services/registration/transaction_pin @@ -1,2 +1,2 @@ -{{.get_recipient}} will receive {{.validate_amount}} from {{.get_sender}} +{{.get_recipient}} will receive {{.get_amount}} from {{.get_sender}} Please enter your PIN to confirm: \ No newline at end of file diff --git a/services/registration/transaction_pin.vis b/services/registration/transaction_pin.vis index cadbdcf..0388f0c 100644 --- a/services/registration/transaction_pin.vis +++ b/services/registration/transaction_pin.vis @@ -1,12 +1,13 @@ -MAP validate_amount +RELOAD get_amount +MAP get_amount RELOAD get_recipient MAP get_recipient RELOAD get_sender MAP get_sender MOUT back 0 MOUT quit 9 -HALT LOAD authorize_account 6 +HALT RELOAD authorize_account CATCH incorrect_pin flag_incorrect_pin 1 INCMP _ 0 diff --git a/services/registration/transaction_pin_swa b/services/registration/transaction_pin_swa index 8529f0e..1924166 100644 --- a/services/registration/transaction_pin_swa +++ b/services/registration/transaction_pin_swa @@ -1,2 +1,2 @@ -{{.get_recipient}} atapokea {{.validate_amount}} kutoka kwa {{.get_sender}} +{{.get_recipient}} atapokea {{.get_amount}} kutoka kwa {{.get_sender}} Tafadhali weka PIN yako kudhibitisha: \ No newline at end of file