From 64e52013969ecfad043e09637e662a2464c8800e Mon Sep 17 00:00:00 2001 From: Noisekit Date: Fri, 3 Nov 2023 13:28:49 +0800 Subject: [PATCH 1/3] Commit test order for 1 ETH --- sandboxes/with-perps/cannonfile.consumer.toml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sandboxes/with-perps/cannonfile.consumer.toml b/sandboxes/with-perps/cannonfile.consumer.toml index 1a3cf36de7..fba7227fa9 100644 --- a/sandboxes/with-perps/cannonfile.consumer.toml +++ b/sandboxes/with-perps/cannonfile.consumer.toml @@ -129,3 +129,13 @@ args = [ 0, # 0 is a special market id for sUSD "<%= parseEther('300') %>", ] + +[invoke.commit_perps_eth_order] +target = ["perps_sandbox.perps_factory.PerpsMarketProxy"] +from = "<%= settings.test_user %>" +func = "commitOrder" +args = [ + # eth price is $1000, acceptablePrice with 5% slippage: $1050 + { marketId = "<%= imports.perps_sandbox.extras.perps_eth_market_id %>", accountId = "<%= extras.test_user_perps_account_id %>", sizeDelta = "<%= parseEther('1') %>", settlementStrategyId = "0", acceptablePrice = "<%= parseEther('1050') %>", referrer = "<%= AddressZero %>", trackingCode = "<%= HashZero %>" }, +] +depends = ["invoke.deposit_300_susd_to_perps"] From 2a868eee40f8d39ca8447a2de3ef24a9b5b29f36 Mon Sep 17 00:00:00 2001 From: Noisekit Date: Fri, 3 Nov 2023 17:12:22 +0800 Subject: [PATCH 2/3] Test transfer susd to another user --- sandboxes/with-perps/cannonfile.consumer.toml | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/sandboxes/with-perps/cannonfile.consumer.toml b/sandboxes/with-perps/cannonfile.consumer.toml index fba7227fa9..acb415313c 100644 --- a/sandboxes/with-perps/cannonfile.consumer.toml +++ b/sandboxes/with-perps/cannonfile.consumer.toml @@ -15,6 +15,10 @@ defaultValue = "69" [setting.test_user_perps_account_id] defaultValue = "420" +[setting.another_user] +defaultValue = "0xa0Ee7A142d267C1f36714E4a8F75612F20a79720" # PK 0x2a871d0798f97d79848a013d4936a73bf4cc922c825d33c1cf7073dff6d409c6 +description = "Hardhat/Anvil test account (9)" + # # # @@ -111,23 +115,23 @@ extra.test_user_perps_account_id.arg = 0 # We want to ensure test user has some susd in their wallet to start interacting with perps market, so adding this dependency step depends = ["invoke.withdraw_300_susd"] -[invoke.approve_300_susd_for_PerpsMarketProxy_to_spend] +[invoke.approve_100_susd_for_PerpsMarketProxy_to_spend] target = ["perps_sandbox.synthetix.USDProxy"] from = "<%= settings.test_user %>" func = "approve" args = [ "<%= imports.perps_sandbox.imports.perps_factory.contracts.PerpsMarketProxy.address %>", - "<%= parseEther('300') %>", + "<%= parseEther('100') %>", ] -[invoke.deposit_300_susd_to_perps] +[invoke.deposit_100_susd_to_perps] target = ["perps_sandbox.perps_factory.PerpsMarketProxy"] from = "<%= settings.test_user %>" func = "modifyCollateral" args = [ "<%= extras.test_user_perps_account_id %>", 0, # 0 is a special market id for sUSD - "<%= parseEther('300') %>", + "<%= parseEther('100') %>", ] [invoke.commit_perps_eth_order] @@ -138,4 +142,11 @@ args = [ # eth price is $1000, acceptablePrice with 5% slippage: $1050 { marketId = "<%= imports.perps_sandbox.extras.perps_eth_market_id %>", accountId = "<%= extras.test_user_perps_account_id %>", sizeDelta = "<%= parseEther('1') %>", settlementStrategyId = "0", acceptablePrice = "<%= parseEther('1050') %>", referrer = "<%= AddressZero %>", trackingCode = "<%= HashZero %>" }, ] -depends = ["invoke.deposit_300_susd_to_perps"] +depends = ["invoke.deposit_100_susd_to_perps"] + +[invoke.transfer_100_susd_to_another_user] +target = ["perps_sandbox.synthetix.USDProxy"] +from = "<%= settings.test_user %>" +func = "transfer" +args = ["<%= settings.another_user %>", "<%= parseEther('100') %>"] +depends = ["invoke.withdraw_300_susd"] From 498adabc3a5fc949da5dca244e8a27406c76253d Mon Sep 17 00:00:00 2001 From: BTCRob1993 <122697853+BTCRob1993@users.noreply.github.com> Date: Sun, 12 Nov 2023 22:29:41 +0100 Subject: [PATCH 3/3] # GitHub CLI api # https://cli.github.com/manual/gh_api gh api \ -H "Accept: application/vnd.github+json" \ -H "X-GitHub-Api-Version: 2022-11-28" \ /