-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from tigerbeetle/fix-exercises-pass-without-cha…
…nges Fix exercises that pass without changes
- Loading branch information
Showing
11 changed files
with
46 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
diff --git a/exercises/031_rate_limiting.sh b/exercises/031_rate_limiting.sh | ||
index ab84362..93c993e 100755 | ||
index d32f976..88f5f76 100755 | ||
--- a/exercises/031_rate_limiting.sh | ||
+++ b/exercises/031_rate_limiting.sh | ||
@@ -13,7 +13,7 @@ tb "create_transfers id=31000 debit_account_id=3100 credit_account_id=3101 amoun | ||
@@ -13,8 +13,8 @@ tb "create_transfers id=31000 debit_account_id=3100 credit_account_id=3101 amoun | ||
|
||
# Now, each time the user makes a request, we'll create a pending transfer with a timeout to temporarily debit the user's account. | ||
# How long should the timeout be? (Hint: the timeout is an interval in seconds.) | ||
-TIMEOUT=??? | ||
-for ((i=1; i<=11; i++)); do | ||
+TIMEOUT=60 | ||
for ((i=1; i<=11; i++)); do | ||
+for ((i=1; i<=10; i++)); do | ||
id=$((31000 + i)) | ||
output=$(tb "create_transfers id=${id} debit_account_id=3101 credit_account_id=3100 amount=1 timeout=${TIMEOUT} ledger=310 code=10 flags=pending;") | ||
tb "create_transfers id=${id} debit_account_id=3101 credit_account_id=3100 amount=1 timeout=${TIMEOUT} ledger=310 code=10 flags=pending;" | ||
done |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
diff --git a/exercises/032_rate_limiting_bandwidth.sh b/exercises/032_rate_limiting_bandwidth.sh | ||
index b280c54..d4d8df8 100755 | ||
index dedb290..14338f7 100755 | ||
--- a/exercises/032_rate_limiting_bandwidth.sh | ||
+++ b/exercises/032_rate_limiting_bandwidth.sh | ||
@@ -15,7 +15,7 @@ tb "create_transfers id=32000 debit_account_id=3200 credit_account_id=3201 amoun | ||
for ((i=1; i<=11; i++)); do | ||
@@ -12,10 +12,10 @@ tb "create_accounts id=3200 code=10 ledger=320, | ||
tb "create_transfers id=32000 debit_account_id=3200 credit_account_id=3201 amount=10000000 ledger=320 code=10;" | ||
|
||
# Let's say that the user is sending requests that are 1 MB each. | ||
-for ((i=1; i<=11; i++)); do | ||
+for ((i=1; i<=10; i++)); do | ||
id=$((32000 + i)) | ||
# What should the amount be? | ||
- amount=??? | ||
+ amount=1000000 | ||
output=$(tb "create_transfers id=${id} debit_account_id=3201 credit_account_id=3200 amount=${amount} timeout=60 ledger=320 code=10 flags=pending;") | ||
echo "$output" | ||
tb "create_transfers id=${id} debit_account_id=3201 credit_account_id=3200 amount=${amount} timeout=60 ledger=320 code=10 flags=pending;" | ||
done | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
diff --git a/exercises/033_rate_limiting_money.sh b/exercises/033_rate_limiting_money.sh | ||
index c4da8b2..c078640 100755 | ||
index 1b4ff82..d5067ab 100755 | ||
--- a/exercises/033_rate_limiting_money.sh | ||
+++ b/exercises/033_rate_limiting_money.sh | ||
@@ -22,8 +22,8 @@ tb "create_transfers id=33000 debit_account_id=3300 credit_account_id=3301 amoun | ||
for ((i=1; i<=11; i++)); do | ||
@@ -19,11 +19,11 @@ tb "create_accounts id=3300 code=10 ledger=$USD_LEDGER, | ||
tb "create_transfers id=33000 debit_account_id=3300 credit_account_id=3301 amount=10000 ledger=$USD_LEDGER code=10, | ||
id=33001 debit_account_id=3302 credit_account_id=3303 amount=100 ledger=$RATE_LIMITING_LEDGER code=10;" | ||
|
||
-for ((i=1; i<=11; i++)); do | ||
+for ((i=1; i<=10; i++)); do | ||
id=$((33002 + (i * 2))) | ||
# What flags should these two transfers have? (Hint: they aren't the same.) | ||
- output=$(tb "create_transfers id=${id} debit_account_id=3301 credit_account_id=3300 amount=10 ledger=$USD_LEDGER code=10 flags=???, | ||
- id=$((id + 1)) debit_account_id=3303 credit_account_id=3302 amount=10 timeout=60 ledger=$RATE_LIMITING_LEDGER code=10 flags=???;") | ||
+ output=$(tb "create_transfers id=${id} debit_account_id=3301 credit_account_id=3300 amount=10 ledger=$USD_LEDGER code=10 flags=linked, | ||
+ id=$((id + 1)) debit_account_id=3303 credit_account_id=3302 amount=10 timeout=60 ledger=$RATE_LIMITING_LEDGER code=10 flags=pending;") | ||
echo "$output" | ||
- tb "create_transfers id=${id} debit_account_id=3301 credit_account_id=3300 amount=10 ledger=$USD_LEDGER code=10 flags=???, | ||
- id=$((id + 1)) debit_account_id=3303 credit_account_id=3302 amount=10 timeout=60 ledger=$RATE_LIMITING_LEDGER code=10 flags=???;" | ||
+ tb "create_transfers id=${id} debit_account_id=3301 credit_account_id=3300 amount=10 ledger=$USD_LEDGER code=10 flags=linked, | ||
+ id=$((id + 1)) debit_account_id=3303 credit_account_id=3302 amount=10 timeout=60 ledger=$RATE_LIMITING_LEDGER code=10 flags=pending;" | ||
done | ||
# The last two of these transfers will fail because the user has exceeded the rate limit. | ||
|
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