Skip to content

Commit

Permalink
fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
wphan committed Jul 5, 2023
1 parent ed9b666 commit 2c9d671
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/driftpy/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from solana.sysvar import SYSVAR_RENT_PUBKEY
from solana.transaction import AccountMeta
from spl.token.constants import TOKEN_PROGRAM_ID
from anchorpy import Program, Context, Idl
from anchorpy import Program, ProgramAccount, Context, Idl

from driftpy.types import *
from driftpy.addresses import *
Expand Down Expand Up @@ -61,9 +61,8 @@ async def get_perp_market_account(program: Program, market_index: int) -> PerpMa
return cast(PerpMarket, response)


async def get_all_perp_market_accounts(program: Program) -> list[PerpMarket]:
response = await program.account["PerpMarket"].all()
return cast(list[PerpMarket], response)
async def get_all_perp_market_accounts(program: Program) -> list[ProgramAccount]:
return await program.account["PerpMarket"].all()


async def get_spot_market_account(
Expand All @@ -76,6 +75,5 @@ async def get_spot_market_account(
return cast(SpotMarket, response)


async def get_all_spot_market_accounts(program: Program) -> list[SpotMarket]:
response = await program.account["SpotMarket"].all()
return cast(list[SpotMarket], response)
async def get_all_spot_market_accounts(program: Program) -> list[ProgramAccount]:
return await program.account["SpotMarket"].all()

0 comments on commit 2c9d671

Please sign in to comment.