bob-test.fs 774 Bytes
Newer Older
bernd's avatar
bernd committed
1 2 3
\ net2o tests - client side

require client-tests.fs
4
require test-keys.fs \ we want the test keys - never use this in production!
bernd's avatar
bernd committed
5 6 7 8 9 10

+db stat(
+debug
%droprate
debug-task

bernd's avatar
bernd committed
11
i'm bob
bernd's avatar
bernd committed
12

bernd's avatar
bernd committed
13 14 15 16 17 18 19
init-client

!time

?nextarg [IF] net2o-host $! [THEN]
?nextarg [IF] s>number drop to net2o-port [THEN]

bernd's avatar
bernd committed
20
: c:revoke-bob ( -- )
bernd's avatar
bernd committed
21
    now>never
bernd's avatar
bernd committed
22 23 24
    x" D82AF4AE7CD3DA7316CE6F26BC5792F4F5E6B36B4C14F7D60C49B421AE1D5468"
    revoke-me ;

25
: c:bob ( -- ) 
bernd's avatar
bernd committed
26
    $2000 $10000 "" ins-ip dup add-beacon c:connect
bernd's avatar
bernd committed
27
    ." Bob connected with: " pkc $20 85type cr
bernd's avatar
bernd committed
28
    c:revoke-bob
bernd's avatar
bernd committed
29
    ." Bob revoked: " pkc $20 85type  cr
bernd's avatar
bernd committed
30
    replace-me
bernd's avatar
bernd committed
31
    ." Bob replaced: " pkc $20 85type  cr
bernd's avatar
bernd committed
32
    do-disconnect ;
bernd's avatar
bernd committed
33

bernd's avatar
bernd committed
34
strict-keys off
bernd's avatar
bernd committed
35 36 37 38
c:bob server-loop
\ ?nextarg [IF] s>number drop [ELSE] 1 [THEN] c:tests

script? [IF] bye [THEN]