adding cic-eth as sub dir
This commit is contained in:
15
apps/cic-eth/doc/flowcharts/Makefile
Normal file
15
apps/cic-eth/doc/flowcharts/Makefile
Normal file
@@ -0,0 +1,15 @@
|
||||
INPUTS = $(wildcard *.dot)
|
||||
OUTPUTS = $(patsubst %.dot, %.png, $(INPUTS))
|
||||
|
||||
.SUFFIXES: .dot .png
|
||||
|
||||
.dot.png:
|
||||
dot -T png $(basename $@).dot > $@
|
||||
|
||||
all: $(OUTPUTS)
|
||||
|
||||
clean:
|
||||
rm -vf *.png
|
||||
|
||||
.PHONY: clean
|
||||
|
||||
21
apps/cic-eth/doc/flowcharts/account_tasks.dot
Normal file
21
apps/cic-eth/doc/flowcharts/account_tasks.dot
Normal file
@@ -0,0 +1,21 @@
|
||||
digraph {
|
||||
|
||||
create_account [
|
||||
label="CIC-ETH API:\create account";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
callback [
|
||||
label="callback";
|
||||
shape="ellipse";
|
||||
style="dashed";
|
||||
];
|
||||
|
||||
create_account -> "eth.account.create";
|
||||
create_account -> "eth.account.register" -> "eth.account.cache_account_data";
|
||||
"eth.account.register" -> "queue.tx,create";
|
||||
"eth.account.register" -> "eth.tx.check_gas";
|
||||
"eth.tx.check_gas" -> "eth.tx.refill_gas" [ style="dashed" ];
|
||||
"eth.tx.check_gas" -> callback [ style="dashed" ];
|
||||
"eth.tx.refill_gas" -> callback [ style="dashed" ];
|
||||
}
|
||||
16
apps/cic-eth/doc/flowcharts/balance_tasks.dot
Normal file
16
apps/cic-eth/doc/flowcharts/balance_tasks.dot
Normal file
@@ -0,0 +1,16 @@
|
||||
digraph {
|
||||
balance [
|
||||
label="CIC-ETH API:\nbalance";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
callback [
|
||||
label="callback";
|
||||
shape="ellipse";
|
||||
style="dashed";
|
||||
];
|
||||
|
||||
balance -> "eth.token.resolve_tokens_by_symbol"
|
||||
"eth.token.resolve_tokens_by_symbol" -> "eth.token.balance"
|
||||
"eth.token.balance" -> callback [ style="dashed" ];
|
||||
}
|
||||
10
apps/cic-eth/doc/flowcharts/callback_gift.dot
Normal file
10
apps/cic-eth/doc/flowcharts/callback_gift.dot
Normal file
@@ -0,0 +1,10 @@
|
||||
digraph {
|
||||
|
||||
tx [
|
||||
label="CIC-MANAGER\ncallbacks filter, tokengift";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
tx -> callback [ style="dashed" ];
|
||||
|
||||
}
|
||||
57
apps/cic-eth/doc/flowcharts/convert_tasks.dot
Normal file
57
apps/cic-eth/doc/flowcharts/convert_tasks.dot
Normal file
@@ -0,0 +1,57 @@
|
||||
digraph {
|
||||
|
||||
convert_transfer [
|
||||
label="CIC-ETH API:\nconvert_transfer";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
callback [
|
||||
label="callback";
|
||||
shape="ellipse";
|
||||
style="dashed";
|
||||
];
|
||||
|
||||
convert_approve_zero [
|
||||
label="eth.token.approve (zero)";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
convert_approve_amount [
|
||||
label="eth.token.approve (amount)";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
cache_approve_zero [
|
||||
label="eth.token.otx_cache_approve";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
cache_approve_amount [
|
||||
label="eth.token.otx_cache_approve";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
queue_approve_zero [
|
||||
label="queue.tx.create";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
queue_approve_amount [
|
||||
label="queue.tx.create";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
convert_transfer -> "eth.token.resolve_tokens_by_symbol" -> "eth.bancor.convert_with_default_reserve";
|
||||
"eth.bancor.convert_with_default_reserve" -> convert_approve_zero -> cache_approve_zero;
|
||||
convert_approve_zero -> queue_approve_zero;
|
||||
"eth.bancor.convert_with_default_reserve" -> convert_approve_amount -> cache_approve_amount;
|
||||
convert_approve_amount -> queue_approve_amount;
|
||||
"eth.bancor.convert_with_default_reserve" -> "eth.bancor.otx_cache_convert";
|
||||
"eth.bancor.convert_with_default_reserve" -> "queue.tx.create";
|
||||
"eth.bancor.convert_with_default_reserve" -> "eth.tx.check_gas";
|
||||
"eth.bancor.convert_with_default_reserve" -> "eth.bancor.save_convert_recipient";
|
||||
"eth.tx.check_gas" -> "eth.tx.refill_gas" [ style="dashed" ];
|
||||
"eth.tx.check_gas" -> callback [ style="dashed" ];
|
||||
"eth.tx.refill_gas" -> callback [ style="dashed" ];
|
||||
|
||||
}
|
||||
15
apps/cic-eth/doc/flowcharts/converttransfer_tasks.dot
Normal file
15
apps/cic-eth/doc/flowcharts/converttransfer_tasks.dot
Normal file
@@ -0,0 +1,15 @@
|
||||
digraph {
|
||||
|
||||
tx [
|
||||
label="CIC-MANAGER;\nconvert_filter";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
tx -> "eth.bancor.transfer_converted" -> "eth.token.otx_cache_transfer";
|
||||
"eth.bancor.transfer_converted" -> "queue.tx.create";
|
||||
"eth.bancor.transfer_converted" -> "eth.bancor.save_convert_transfer";
|
||||
"eth.bancor.transfer_converted" -> "eth.tx.check_gas";
|
||||
"eth.tx.check_gas" -> "eth.tx.refill_gas" [ style="dashed" ];
|
||||
"eth.tx.check_gas" -> callback [ style="dashed" ];
|
||||
"eth.tx.refill_gas" -> callback [ style="dashed" ];
|
||||
}
|
||||
159
apps/cic-eth/doc/flowcharts/dispatch.dot
Normal file
159
apps/cic-eth/doc/flowcharts/dispatch.dot
Normal file
@@ -0,0 +1,159 @@
|
||||
digraph G {
|
||||
|
||||
send [
|
||||
label = "transfer";
|
||||
shape = "ellipse";
|
||||
];
|
||||
|
||||
params [
|
||||
label = "get token, value, sender, recipient";
|
||||
shape = "parallelogram";
|
||||
];
|
||||
|
||||
token_lookup [
|
||||
label = "token known?";
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
token_lookup_x [
|
||||
xlabel = "UnknownTokenError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
nonce [
|
||||
label = "get sender nonce";
|
||||
shape = "box";
|
||||
style = "dashed";
|
||||
];
|
||||
|
||||
sign_tx [
|
||||
label = "sign tx";
|
||||
shape = "box";
|
||||
];
|
||||
|
||||
sign_tx_x [
|
||||
xlabel = "SignerError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
cache [
|
||||
label = "queue signed tx";
|
||||
shape = "cylinder";
|
||||
];
|
||||
|
||||
gas [
|
||||
label = "safe sender balance for gas?";
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
gas_rq_exists [
|
||||
label = "gas request already pending?"
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
gas_rq [
|
||||
label = "queue request for gas";
|
||||
shape = "parallelogram";
|
||||
];
|
||||
|
||||
gas_tx [
|
||||
label = "enough gas for this tx?";
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
cache_waitforgas [
|
||||
label = "set status to WAITFORGAS";
|
||||
shape = "parallelogram";
|
||||
];
|
||||
|
||||
gas_tx_x [
|
||||
xlabel = "OutOfGasError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
tx_fail [
|
||||
label = "temporary error?"
|
||||
shape = "diamond"
|
||||
];
|
||||
|
||||
tx_fail_known [
|
||||
label = "known error?"
|
||||
shape = "diamond"
|
||||
];
|
||||
|
||||
cache_sent [
|
||||
label = "set tx status to SENT";
|
||||
shape = "cylinder";
|
||||
];
|
||||
|
||||
cache_unsent [
|
||||
label = "set tx status to SENDFAIL";
|
||||
shape = "cylinder";
|
||||
];
|
||||
|
||||
cache_revert [
|
||||
label = "set tx status to REVERTED";
|
||||
shape = "cylinder";
|
||||
];
|
||||
|
||||
cache_fubar [
|
||||
label = "set tx status to FUBAR";
|
||||
shape = "cylinder";
|
||||
];
|
||||
|
||||
send_tx_x_tmp [
|
||||
xlabel = "TemporaryTxError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
send_tx_x_final [
|
||||
xlabel = "PermanentTxError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
ok [
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
|
||||
send -> params -> token_lookup;
|
||||
|
||||
token_lookup -> token_lookup_x [ label = "no"; ];
|
||||
|
||||
token_lookup -> nonce [ label = "yes"; ];
|
||||
nonce -> sign_tx;
|
||||
|
||||
sign_tx -> sign_tx_x [ label = "fail"; ];
|
||||
|
||||
sign_tx -> cache [ label = "ok"; ];
|
||||
cache -> gas;
|
||||
|
||||
gas -> gas_rq_exists [ label = "no"; ];
|
||||
gas_rq_exists -> gas_rq [ label = "no"; ];
|
||||
gas_rq_exists -> gas_tx [ label = "yes"; ];
|
||||
gas_rq -> gas_tx;
|
||||
|
||||
gas -> send_tx [ label = "yes"; ];
|
||||
|
||||
gas_tx -> cache_waitforgas -> gas_tx_x [ label = "no"; ];
|
||||
|
||||
gas_tx -> send_tx [ label = "yes"; ];
|
||||
|
||||
send_tx -> tx_fail [ label = "fail"; ];
|
||||
|
||||
tx_fail -> cache_unsent [ label = "yes"; ];
|
||||
cache_unsent -> send_tx_x_tmp;
|
||||
|
||||
tx_fail -> tx_fail_known [ label = "no"; ];
|
||||
|
||||
tx_fail_known -> cache_fubar [ label = "no"; ];
|
||||
|
||||
cache_fubar -> send_tx_x_final;
|
||||
|
||||
tx_fail_known -> cache_revert [ label = "yes"; ];
|
||||
cache_revert -> send_tx_x_final;
|
||||
|
||||
send_tx -> cache_sent [ label = "ok"; ];
|
||||
cache_sent -> ok;
|
||||
|
||||
}
|
||||
3
apps/cic-eth/doc/flowcharts/readme
Normal file
3
apps/cic-eth/doc/flowcharts/readme
Normal file
@@ -0,0 +1,3 @@
|
||||
All *_tasks.dot files describe literal the literal tasks that get executed on the associated entry points. CIC-ETH API entrypoints refer to methods in "cic_eth/api/api_task.py"
|
||||
|
||||
All *_semantic.dot files are flow charts decribing the processing of the associated entry points.
|
||||
12
apps/cic-eth/doc/flowcharts/register_tasks.dot
Normal file
12
apps/cic-eth/doc/flowcharts/register_tasks.dot
Normal file
@@ -0,0 +1,12 @@
|
||||
digraph {
|
||||
|
||||
send [
|
||||
label="CIC-MANAGER\nregistration filter";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
send -> "eth.account.gift" -> "eth.account.cache_gift_data";
|
||||
"eth.account.gift" -> "queue.tx.create";
|
||||
"eth.account.gift" -> "eth.tx.check_gas";
|
||||
"eth.tx.check_gas" -> "eth.tx.refill_gas" [ style="dashed" ];
|
||||
}
|
||||
17
apps/cic-eth/doc/flowcharts/send_tasks.dot
Normal file
17
apps/cic-eth/doc/flowcharts/send_tasks.dot
Normal file
@@ -0,0 +1,17 @@
|
||||
digraph {
|
||||
|
||||
dispatcher [
|
||||
label="CIC-ETH-DISPATCHER";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
send [
|
||||
label="eth.tx.send";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
dispatcher -> send;
|
||||
send -> "queue.tx.set_[sent|final|fubar]_status";
|
||||
send -> "(send tx on blockchain)";
|
||||
"queue.tx.set_[sent|final|fubar]_status" -> send [ style="dashed" ];
|
||||
}
|
||||
104
apps/cic-eth/doc/flowcharts/transaction_semantic.dot
Normal file
104
apps/cic-eth/doc/flowcharts/transaction_semantic.dot
Normal file
@@ -0,0 +1,104 @@
|
||||
digraph G {
|
||||
|
||||
send [
|
||||
label = "transfer";
|
||||
shape = "ellipse";
|
||||
];
|
||||
|
||||
params [
|
||||
label = "get token, value, sender, recipient";
|
||||
shape = "parallelogram";
|
||||
];
|
||||
|
||||
token_lookup [
|
||||
label = "token known?";
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
token_lookup_x [
|
||||
xlabel = "UnknownTokenError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
nonce [
|
||||
label = "get sender nonce";
|
||||
shape = "box";
|
||||
style = "dashed";
|
||||
];
|
||||
|
||||
sign_tx [
|
||||
label = "sign tx";
|
||||
shape = "box";
|
||||
];
|
||||
|
||||
sign_tx_x [
|
||||
xlabel = "SignerError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
cache [
|
||||
label = "queue signed tx";
|
||||
shape = "cylinder";
|
||||
];
|
||||
|
||||
gas [
|
||||
label = "safe sender balance for gas?";
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
gas_rq_exists [
|
||||
label = "gas request already pending?"
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
gas_rq [
|
||||
label = "queue request for gas";
|
||||
shape = "parallelogram";
|
||||
];
|
||||
|
||||
gas_tx [
|
||||
label = "enough gas for this tx?";
|
||||
shape = "diamond";
|
||||
];
|
||||
|
||||
cache_waitforgas [
|
||||
label = "set status to WAITFORGAS";
|
||||
shape = "parallelogram";
|
||||
];
|
||||
|
||||
gas_tx_x [
|
||||
xlabel = "OutOfGasError";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
ok [
|
||||
xlabel = "OK";
|
||||
shape = "point";
|
||||
];
|
||||
|
||||
|
||||
send -> params -> token_lookup;
|
||||
|
||||
token_lookup -> token_lookup_x [ label = "no"; ];
|
||||
|
||||
token_lookup -> nonce [ label = "yes"; ];
|
||||
nonce -> sign_tx;
|
||||
|
||||
sign_tx -> sign_tx_x [ label = "fail"; ];
|
||||
|
||||
sign_tx -> cache [ label = "ok"; ];
|
||||
cache -> gas;
|
||||
|
||||
gas -> gas_rq_exists [ label = "no"; ];
|
||||
gas_rq_exists -> gas_rq [ label = "no"; ];
|
||||
gas_rq_exists -> gas_tx [ label = "yes"; ];
|
||||
gas_rq -> gas_tx;
|
||||
|
||||
gas -> ok [ label = "yes"; ];
|
||||
|
||||
gas_tx -> cache_waitforgas -> gas_tx_x [ label = "no"; ];
|
||||
|
||||
gas_tx -> ok [ label = "yes"; ];
|
||||
|
||||
|
||||
}
|
||||
22
apps/cic-eth/doc/flowcharts/transaction_tasks.dot
Normal file
22
apps/cic-eth/doc/flowcharts/transaction_tasks.dot
Normal file
@@ -0,0 +1,22 @@
|
||||
digraph {
|
||||
|
||||
send [
|
||||
label="CIC-ETH API:\ntransfer";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
callback [
|
||||
label="callback";
|
||||
shape="ellipse";
|
||||
style="dashed";
|
||||
];
|
||||
|
||||
send -> "eth.token.resolve_tokens_by_symbol"
|
||||
"eth.token.resolve_tokens_by_symbol" -> "eth.token.transfer" -> "eth.queue.otx_cache_transfer";
|
||||
"eth.token.transfer" -> "eth.queue.tx.create";
|
||||
"eth.token.transfer" -> "eth.tx.check_gas";
|
||||
"eth.tx.check_gas" -> "eth.tx.refill_gas" [ style="dashed" ];
|
||||
"eth.tx.check_gas" -> callback [ style="dashed" ];
|
||||
"eth.tx.refill_gas" -> callback [ style="dashed" ];
|
||||
|
||||
}
|
||||
65
apps/cic-eth/doc/flowcharts/transferauthorization_tasks.dot
Normal file
65
apps/cic-eth/doc/flowcharts/transferauthorization_tasks.dot
Normal file
@@ -0,0 +1,65 @@
|
||||
digraph {
|
||||
|
||||
transferauthorization [
|
||||
label="CIC-ETH API:\ntransfer authorization";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
callback [
|
||||
label="callback";
|
||||
shape="ellipse";
|
||||
style="dashed";
|
||||
];
|
||||
|
||||
resolve_transferauthorization [
|
||||
label="eth.token.resolve_tokens_by_symbol";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
resolve_approve [
|
||||
label="eth.token.resolve_tokens_by_symbol";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
checkgas_transferauthorization [
|
||||
label="eth.tx.check_gas";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
checkgas_approve [
|
||||
label="eth.tx.check_gas";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
refill_transferauthorization [
|
||||
label="eth.tx.refill_gas";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
refill_approve [
|
||||
label="eth.tx.refill_gas";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
queue_create_transferauthorization [
|
||||
label="queue.tx.create";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
queue_create_approve [
|
||||
label="queue.tx.create";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
transferauthorization -> resolve_approve -> "eth.token.approve" -> "eth.token.otx_cache_approve";
|
||||
"eth.token.approve" -> queue_create_approve;
|
||||
"eth.token.approve" -> checkgas_approve;
|
||||
checkgas_approve -> refill_approve [ style="dashed" ];
|
||||
|
||||
transferauthorization -> resolve_transferauthorization -> "eth.request.transfer_approve_request" -> "eth.token.otx_cache_transfer_approval_request";
|
||||
"eth.request.transfer_approve_request" -> queue_create_transferauthorization;
|
||||
"eth.request.transfer_approve_request" -> checkgas_transferauthorization;
|
||||
checkgas_transferauthorization -> refill_transferauthorization [ style="dashed" ];
|
||||
checkgas_approve -> callback [ style="dashed" ];
|
||||
refill_approve -> callback [ style="dashed" ];
|
||||
}
|
||||
9
apps/cic-eth/doc/flowcharts/tx_tasks.dot
Normal file
9
apps/cic-eth/doc/flowcharts/tx_tasks.dot
Normal file
@@ -0,0 +1,9 @@
|
||||
digraph {
|
||||
|
||||
tx [
|
||||
label="CIC-MANAGER;\ntx_filter";
|
||||
shape="ellipse";
|
||||
];
|
||||
|
||||
tx -> "queue.tx.set_final_status";
|
||||
}
|
||||
Reference in New Issue
Block a user