Skip to content
Permalink
Browse files

chore: Fix e2e tests and docs

  • Loading branch information...
gakonst committed Sep 8, 2019
1 parent 89bec2e commit 461ec7c48cd2e965994993d789523bb64f46d3fa
@@ -42,7 +42,7 @@ impl FromStr for RoutingRelation {

fn from_str(string: &str) -> Result<Self, ()> {
match string.to_lowercase().as_str() {
"non_routing_account" => Ok(RoutingRelation::NonRoutingAccount),
"nonroutingaccount" => Ok(RoutingRelation::NonRoutingAccount),
"parent" => Ok(RoutingRelation::Parent),
"peer" => Ok(RoutingRelation::Peer),
"child" => Ok(RoutingRelation::Child),
@@ -97,9 +97,7 @@ fn eth_ledger_settlement() {
min_balance: None,
settle_threshold: None,
settle_to: Some(-10),
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -120,9 +118,7 @@ fn eth_ledger_settlement() {
min_balance: Some(-100),
settle_threshold: Some(70),
settle_to: Some(10),
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -168,9 +164,7 @@ fn eth_ledger_settlement() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -192,9 +186,7 @@ fn eth_ledger_settlement() {
min_balance: Some(-100),
settle_threshold: Some(70),
settle_to: Some(-10),
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -131,9 +131,7 @@ fn eth_xrp_interoperable() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -156,8 +154,6 @@ fn eth_xrp_interoperable() {
min_balance: Some(-100_000),
settle_threshold: Some(70000),
settle_to: Some(10000),
send_routes: true,
receive_routes: true,
routing_relation: Some("Peer".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -198,8 +194,6 @@ fn eth_xrp_interoperable() {
min_balance: Some(-100_000),
settle_threshold: None,
settle_to: None,
send_routes: true,
receive_routes: true,
routing_relation: Some("Peer".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -221,8 +215,6 @@ fn eth_xrp_interoperable() {
min_balance: Some(-100),
settle_threshold: Some(70000),
settle_to: Some(5000),
send_routes: false,
receive_routes: true,
routing_relation: Some("Child".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -284,9 +276,7 @@ fn eth_xrp_interoperable() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -307,8 +297,6 @@ fn eth_xrp_interoperable() {
min_balance: Some(-100_000),
settle_threshold: None,
settle_to: None,
send_routes: true,
receive_routes: false,
routing_relation: Some("Parent".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -106,9 +106,7 @@ fn xrp_ledger_settlement() {
min_balance: None,
settle_threshold: None,
settle_to: Some(-10),
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -129,9 +127,7 @@ fn xrp_ledger_settlement() {
min_balance: Some(-100),
settle_threshold: Some(70),
settle_to: Some(10),
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -169,9 +165,7 @@ fn xrp_ledger_settlement() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -193,9 +187,7 @@ fn xrp_ledger_settlement() {
min_balance: Some(-100),
settle_threshold: Some(70),
settle_to: Some(-10),
send_routes: false,
receive_routes: false,
routing_relation: None,
routing_relation: Some("NonRoutingAccount".to_owned()),
round_trip_time: None,
packets_per_minute_limit: None,
amount_per_minute_limit: None,
@@ -600,8 +600,6 @@ fn run_node_accounts_add(opt: NodeAccountsAddOpt) {
min_balance: Some(opt.min_balance),
settle_threshold: opt.settle_threshold,
settle_to: opt.settle_to,
send_routes: opt.send_routes,
receive_routes: opt.receive_routes,
routing_relation: Some(opt.routing_relation.clone()),
round_trip_time: Some(opt.round_trip_time),
packets_per_minute_limit: opt.packets_per_minute_limit,
@@ -681,10 +679,6 @@ struct NodeAccountsAddOpt {
http_incoming_token: Option<String>,
settle_threshold: Option<i64>,
settle_to: Option<i64>,
#[serde(default)]
send_routes: bool,
#[serde(default)]
receive_routes: bool,
routing_relation: String,
min_balance: i64,
round_trip_time: u32,
@@ -53,8 +53,6 @@ fn btp_end_to_end() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
round_trip_time: None,
packets_per_minute_limit: None,
@@ -75,8 +73,6 @@ fn btp_end_to_end() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
round_trip_time: None,
packets_per_minute_limit: None,
@@ -74,8 +74,6 @@ fn three_nodes() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
round_trip_time: None,
packets_per_minute_limit: None,
@@ -99,8 +97,6 @@ fn three_nodes() {
min_balance: Some(-1_000_000_000),
settle_threshold: None,
settle_to: None,
send_routes: true,
receive_routes: true,
routing_relation: Some("Peer".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -138,8 +134,6 @@ fn three_nodes() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: true,
receive_routes: true,
routing_relation: Some("Peer".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -161,8 +155,6 @@ fn three_nodes() {
min_balance: Some(-1_000_000_000),
settle_threshold: None,
settle_to: None,
send_routes: true,
receive_routes: false,
routing_relation: Some("Child".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -217,8 +209,6 @@ fn three_nodes() {
min_balance: None,
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: false,
routing_relation: None,
round_trip_time: None,
packets_per_minute_limit: None,
@@ -240,8 +230,6 @@ fn three_nodes() {
min_balance: Some(-1_000_000_000),
settle_threshold: None,
settle_to: None,
send_routes: false,
receive_routes: true,
routing_relation: Some("Parent".to_string()),
round_trip_time: None,
packets_per_minute_limit: None,
@@ -40,8 +40,6 @@ Optional fields include:
"btp_incoming_token": "btp auth token they will use to authenticate with us",
"settle_threshold": 1000000000,
"settle_to": 0,
"send_routes": true,
"receive_routes": false,
"routing_relation": "Peer",
"round_trip_time": 500,
"amount_per_minute_limit": 1000000000,
@@ -249,10 +249,8 @@ curl \
"settle_threshold": 500,
"min_balance": -1000,
"settle_to" : 0,
"routing_relation": "Peer",
"send_routes": true,
"receive_routes": true}' \
http://localhost:7770/accounts > logs/account-alice-bob.log 2>/dev/null
"routing_relation": "Peer"}' \
http://localhost:7770/accounts > logs/account-alice-bob.log 2>/dev/null &
printf "Adding Alice's account on Bob's node...\n"
curl \
@@ -271,10 +269,8 @@ curl \
"settle_threshold": 500,
"min_balance": -1000,
"settle_to" : 0,
"routing_relation": "Peer",
"send_routes": true,
"receive_routes": true}' \
http://localhost:8770/accounts > logs/account-bob-alice.log 2>/dev/null
"routing_relation": "Peer"}' \
http://localhost:8770/accounts > logs/account-bob-alice.log 2>/dev/null &
sleep 2
```
@@ -341,10 +341,8 @@ curl \
"settle_threshold": 500,
"min_balance": -1000,
"settle_to" : 0,
"routing_relation": "Peer",
"send_routes": true,
"receive_routes": true}' \
http://localhost:7770/accounts > logs/account-alice-bob.log 2>/dev/null
"routing_relation": "Peer"}' \
http://localhost:7770/accounts > logs/account-alice-bob.log 2>/dev/null &
printf "Adding Alice's account on Bob's node (ETH Peer relation)...\n"
curl \
@@ -363,9 +361,7 @@ curl \
"settle_threshold": 500,
"min_balance": -1000,
"settle_to" : 0,
"routing_relation": "Peer",
"send_routes": true,
"receive_routes": true}' \
"routing_relation": "Peer"}' \
http://localhost:8770/accounts > logs/account-bob-alice.log 2>/dev/null
printf "Adding Charlie's account on Bob's node (XRP Child relation)...\n"
@@ -385,10 +381,8 @@ curl \
"settle_threshold": 500,
"min_balance": -1000,
"settle_to" : 0,
"routing_relation": "Child",
"send_routes": false,
"receive_routes": true}' \
http://localhost:8770/accounts > logs/account-bob-charlie.log 2>/dev/null
"routing_relation": "Child"}' \
http://localhost:8770/accounts > logs/account-bob-charlie.log 2>/dev/null &
printf "Adding Bob's account on Charlie's node (XRP Parent relation)...\n"
curl \
@@ -407,9 +401,7 @@ curl \
"settle_threshold": 500,
"min_balance": -1000,
"settle_to" : 0,
"routing_relation": "Parent",
"send_routes": false,
"receive_routes": true}' \
"routing_relation": "Parent"}' \
http://localhost:9770/accounts > logs/account-charlie-bob.log 2>/dev/null
sleep 2
@@ -93,7 +93,7 @@ printf "\n---------------------------------------\n"
# insert Bob's account details on Alice's connector (ETH Peer relation)
echo "Initializing Bob's account on Alice's connector (this will not return until Bob adds Alice in his connector)"
curl http://localhost:7770/accounts -X POST \
-d "ilp_address=example.bob&asset_code=ETH&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3000&http_endpoint=http://127.0.0.1:8770/ilp&http_incoming_token=bob&http_outgoing_token=alice&settle_threshold=70&min_balance=-100&settle_to=10&routing_relation=Peer&receive_routes=true&send_routes=true" \
-d "ilp_address=example.bob&asset_code=ETH&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3000&http_endpoint=http://127.0.0.1:8770/ilp&http_incoming_token=bob&http_outgoing_token=alice&settle_threshold=70&min_balance=-100&settle_to=10&routing_relation=Peer" \
-H "Authorization: Bearer hi_alice" &

printf "\n---------------------------------------\n"
@@ -104,13 +104,13 @@ read -p "Press [Enter] key to continue..."
# insert Alice's account details on Bob's connector (ETH Peer relation)
echo "Initializing Alice's account on Bob's connector (Alice has already added Bob as a peer so they should exchange SE addreses)"
curl http://localhost:8770/accounts -X POST \
-d "ilp_address=example.alice&asset_code=ETH&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3001&http_endpoint=http://127.0.0.1:7770/ilp&http_incoming_token=alice&http_outgoing_token=bob&settle_threshold=70&min_balance=-100&settle_to=-10&routing_relation=Peer&receive_routes=true&send_routes=true" \
-d "ilp_address=example.alice&asset_code=ETH&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3001&http_endpoint=http://127.0.0.1:7770/ilp&http_incoming_token=alice&http_outgoing_token=bob&settle_threshold=70&min_balance=-100&settle_to=-10&routing_relation=Peer" \
-H "Authorization: Bearer hi_bob"

# insert Charlie's account details on Bob's connector (XRP Child Relation)
echo "Initializing Charlie's account on Bob's connector (this will not return until Charlie adds Bob in his connector)"
curl http://localhost:8770/accounts -X POST \
-d "ilp_address=example.bob.charlie&asset_code=XRP&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3002&http_endpoint=http://127.0.0.1:9770/ilp&http_incoming_token=charlie&http_outgoing_token=bob&settle_threshold=70&min_balance=-100&settle_to=10&routing_relation=Child&receive_routes=true&send_routes=false" \
-d "ilp_address=example.bob.charlie&asset_code=XRP&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3002&http_endpoint=http://127.0.0.1:9770/ilp&http_incoming_token=charlie&http_outgoing_token=bob&settle_threshold=70&min_balance=-100&settle_to=10&routing_relation=Child" \
-H "Authorization: Bearer hi_bob" &

sleep 2
@@ -128,7 +128,7 @@ printf "\n---------------------------------------\n"
# insert Bob's account details on Alice's connector (XRP Peer relation)
echo "Initializing Bob's account on Charlie's connector (this will not return until Bob adds Alice in his connector)"
curl http://localhost:9770/accounts -X POST \
-d "ilp_address=example.bob&asset_code=XRP&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3003&http_endpoint=http://127.0.0.1:8770/ilp&http_incoming_token=bob&http_outgoing_token=charlie&settle_threshold=70&min_balance=-100&settle_to=10&routing_relation=Parent&receive_routes=true&send_routes=false" \
-d "ilp_address=example.bob&asset_code=XRP&asset_scale=6&max_packet_amount=10&settlement_engine_url=http://127.0.0.1:3003&http_endpoint=http://127.0.0.1:8770/ilp&http_incoming_token=bob&http_outgoing_token=charlie&settle_threshold=70&min_balance=-100&settle_to=10&routing_relation=Parent" \
-H "Authorization: Bearer hi_charlie" &

# Set the exchange rate between ETH and XRP
@@ -171,9 +171,7 @@ curl \
"http_outgoing_token": "node_a:node_a-password",
"http_endpoint": "http://localhost:8770/ilp",
"min_balance": -100000,
"routing_relation": "Peer",
"send_routes": true,
"receive_routes": true}' \
"routing_relation": "Peer"}' \
http://localhost:7770/accounts
# Insert accounts on Node B
@@ -206,9 +204,7 @@ curl \
"http_outgoing_token": "node_b:node_b-password",
"http_endpoint": "http://localhost:7770/ilp",
"min_balance": -100000,
"routing_relation": "Peer",
"send_routes": true,
"receive_routes": true}' \
"routing_relation": "Peer"}' \
http://localhost:8770/accounts
```

0 comments on commit 461ec7c

Please sign in to comment.
You can’t perform that action at this time.