Skip to content

Commit c4b9d2c

Browse files
test: minor python fixes (#185)
1 parent d9a59e2 commit c4b9d2c

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

devnet_tests/conftest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,9 @@
109109
PERPETUALS_CONTRACT_ADDRESS = 0x062DA0780FAE50D68CECAA5A051606DC21217BA290969B302DB4DD99D2E9B470
110110
OPERATOR_ADDRESS = 0x048DDC53F41523D2A6B40C3DFF7F69F4BBAC799CD8B2E3FC50D3DE1D4119441F
111111
UPGRADE_GOVERNOR_ADDRESS = 0x0562BBB386BB3EF6FFB94878EC77C0779487F277DEA89568F1CD7CDF958EDDE7
112-
APP_GOVERNOR_ADDRESS = 0x3CCFFE0137EA21294C1CC28F6C29DD495F5B9F1101EC86AE53EF51178AEFA2
113-
GOVERNANCE_ADMIN_ADDRESS = 0x522E5BA327BFBD85138B29BDE060A5340A460706B00AE2E10E6D2A16FBF8C57
112+
APP_GOVERNOR_ADDRESS = 0x003CCFFE0137EA21294C1CC28F6C29DD495F5B9F1101EC86AE53EF51178AEFA2
113+
# Extended governance admin is also app role admin
114+
GOVERNANCE_ADMIN_ADDRESS = 0x0522E5BA327BFBD85138B29BDE060A5340A460706B00AE2E10E6D2A16FBF8C57
114115
RICH_USDC_HOLDER_ADDRESS = 0x054A6DF48915BE451CD6650C3697C5789B934EB2A89D90CBB71E3234F24F0311
115116

116117

devnet_tests/perpetuals_test_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
# Required for hash computations.
2828
ORDER_ARGS_HASH = 0x36DA8D51815527CABFAA9C982F564C80FA7429616739306036F1F9B608DD112
29-
WITHDEAW_ARGS_HASH = 0x250A5FA378E8B771654BD43DCB34844534F9D1E29E16B14760D7936EA7F4B1D
29+
WITHDRAW_ARGS_HASH = 0x250A5FA378E8B771654BD43DCB34844534F9D1E29E16B14760D7936EA7F4B1D
3030
INVEST_REDEEM_VAULT_ARGS_HASH = 0x03C79B3B5997E78A29AB2FB5E8BC8244F222C5E01AE914C10F956BD0F805199A
3131
TRANSFER_ARGS_HASH = 0x1DB88E2709FDF2C59E651D141C3296A42B209CE770871B40413EA109846A3B4
3232
STARKNET_DOMAIN_HASH = 0x1FF2F602E42168014D405A94F75E8A93D640751D71D16311266E140D8B0A210
@@ -503,13 +503,14 @@ async def process_vault_invest_deposit(
503503
depositer_address = self.perpetuals_contract_address
504504
await self.__process_deposit(depositer_address, asset_id, position_id, amount, salt)
505505

506-
async def withdraw(self, account: Account, amount: int, expiration: int):
506+
async def withdraw(self, account: Account, amount: int):
507+
expiration = self.now_timestamp + WEEK_IN_SECONDS
507508
salt = random.randint(0, MAX_UINT32)
508509
collateral_asset_id = await self.get_collateral_asset_id()
509510

510511
signature = self.sign_message(
511512
account,
512-
WITHDEAW_ARGS_HASH,
513+
WITHDRAW_ARGS_HASH,
513514
[
514515
self.get_account_address(account),
515516
self.get_account_position_id(account),

devnet_tests/system_test.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ async def test_deposit_withdraw(test_utils: PerpetualsTestUtils):
109109

110110
# Test withdraw
111111
withdraw_amount = 5
112-
expiration = 3765971800 # Some future timestamp
113-
await test_utils.withdraw(account, withdraw_amount, expiration)
112+
await test_utils.withdraw(account, withdraw_amount)
114113

115114
# Verify position total value decreased by withdraw amount
116115
tv_after_withdraw = await test_utils.get_position_total_value(position_id)

0 commit comments

Comments
 (0)