-
Notifications
You must be signed in to change notification settings - Fork 499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build_test_scenarios fails #614
Labels
Comments
You are right, this is happening because of offer liabilities changes in V10: basically accounts trying to sell more assets than they have. diff --git a/services/horizon/internal/test/scenarios/order_books.rb b/services/horizon/internal/test/scenarios/order_books.rb
index 04168c6..e24127d 100644
--- a/services/horizon/internal/test/scenarios/order_books.rb
+++ b/services/horizon/internal/test/scenarios/order_books.rb
@@ -3,8 +3,8 @@ run_recipe File.dirname(__FILE__) + "/_common_accounts.rb"
use_manual_close
create_account :usd_gateway
-create_account :scott, :master, "6000.0"
-create_account :andrew, :master, "6000.0"
+create_account :scott, :master, "10000.0"
+create_account :andrew, :master, "10000.0"
close_ledger
@@ -19,14 +19,14 @@ close_ledger
payment :usd_gateway, :scott, ["USD", :usd_gateway, "5000.0"]
payment :usd_gateway, :andrew, ["USD", :usd_gateway, "5000.0"]
-payment :usd_gateway, :scott, ["BTC", :usd_gateway, "5000.0"]
-payment :usd_gateway, :andrew, ["BTC", :usd_gateway, "5000.0"]
+payment :usd_gateway, :scott, ["BTC", :usd_gateway, "6000.0"]
+payment :usd_gateway, :andrew, ["BTC", :usd_gateway, "6000.0"]
close_ledger
-offer :scott, {buy:["USD", :usd_gateway], with: :native}, "10", "10.0"
-offer :scott, {buy:["USD", :usd_gateway], with: :native}, "100", "9.0"
-offer :scott, {buy:["USD", :usd_gateway], with: :native}, "1000", "5.0"
+offer :scott, {buy:["USD", :usd_gateway], with: :native}, "10", "10.0" # price = 1/10; amount = 10*10 = 100
+offer :scott, {buy:["USD", :usd_gateway], with: :native}, "100", "9.0" # price = 1/9; amount = 100*9 = 900
+offer :scott, {buy:["USD", :usd_gateway], with: :native}, "1000", "5.0" # price = 1/5; amount = 1000*5 = 5000
offer :andrew, {sell:["USD", :usd_gateway], for: :native}, "10", "15.0"
offer :andrew, {sell:["USD", :usd_gateway], for: :native}, "100", "20.0"
@@ -34,9 +34,9 @@ offer :andrew, {sell:["USD", :usd_gateway], for: :native}, "1000", "50.0"
close_ledger
-offer :scott, {buy:["USD", :usd_gateway], with: ["BTC", :usd_gateway]}, 10, "10.0"
-offer :scott, {buy:["USD", :usd_gateway], with: ["BTC", :usd_gateway]}, 100, "9.0"
-offer :scott, {buy:["USD", :usd_gateway], with: ["BTC", :usd_gateway]}, 1000, "5.0"
+offer :scott, {buy:["USD", :usd_gateway], with: ["BTC", :usd_gateway]}, 10, "10.0" # price = 1/10; amount = 10*10 = 100
+offer :scott, {buy:["USD", :usd_gateway], with: ["BTC", :usd_gateway]}, 100, "9.0" # price = 1/9; amount = 100*9 = 900
+offer :scott, {buy:["USD", :usd_gateway], with: ["BTC", :usd_gateway]}, 1000, "5.0" # price = 1/5; amount = 1000*5 = 5000
offer :andrew, {sell:["USD", :usd_gateway], for: ["BTC", :usd_gateway]}, 10, "15.0"
offer :andrew, {sell:["USD", :usd_gateway], for: ["BTC", :usd_gateway]}, 100, "20.0"
diff --git a/services/horizon/internal/test/scenarios/order_books_310.rb b/services/horizon/internal/test/scenarios/order_books_310.rb
index 6973772..73a46f0 100644
--- a/services/horizon/internal/test/scenarios/order_books_310.rb
+++ b/services/horizon/internal/test/scenarios/order_books_310.rb
@@ -5,7 +5,7 @@ run_recipe File.dirname(__FILE__) + "/_common_accounts.rb"
use_manual_close
create_account :usd_gateway
-create_account :scott, :master, "6000.0"
+create_account :scott, :master, "1000000.0"
create_account :andrew, :master, "6000.0"
close_ledger
diff --git a/services/horizon/internal/test/scenarios/paths.rb b/services/horizon/internal/test/scenarios/paths.rb
index 86ad1ed..154c7c8 100644
--- a/services/horizon/internal/test/scenarios/paths.rb
+++ b/services/horizon/internal/test/scenarios/paths.rb
@@ -9,7 +9,7 @@ account :trader, Stellar::KeyPair.from_seed("SAAHOOTVIZJVXOEPCTNKYTYOTKZA3MFXJ3A
use_manual_close
-create_account :gateway
+create_account :gateway, :master, 10000
create_account :payer
create_account :payee
create_account :trader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As I was building the test schemas for #586 , running
bash build_test_scenarios.bash
(link) fails due to invalid transactions. I did not dig super deep yet, however my hunch is that it is related to the new v10 orderbook changes.Failing recipes:
To Reproduce
Fails and then in the
order_book-core.sql
file I see:The text was updated successfully, but these errors were encountered: