@@ -114,12 +114,6 @@ async def fetch_minimum_balance(self, size: int) -> int:
114
114
async with AsyncClient (self .rpc_endpoint ) as client :
115
115
return (await client .get_minimum_balance_for_rent_exemption (size )).value
116
116
117
- async def account_exists (self , key : PublicKey ) -> bool :
118
- async with AsyncClient (self .rpc_endpoint ) as client :
119
- response = await client .get_account_info (key )
120
- # The RPC returns null if the account does not exist
121
- return bool (response .value )
122
-
123
117
async def refresh_program_accounts (self ):
124
118
async with AsyncClient (self .rpc_endpoint ) as client :
125
119
logger .info ("Refreshing program accounts" )
@@ -711,7 +705,7 @@ async def sync_publisher_program(
711
705
)
712
706
713
707
# Initialize the publisher program config if it does not exist
714
- if not (await self . account_exists (publisher_program_config )):
708
+ if not (await account_exists (self . rpc_endpoint , publisher_program_config )):
715
709
initialize_publisher_program_instruction = initialize_publisher_program (
716
710
self .publisher_program_key , authority .public_key
717
711
)
@@ -723,7 +717,7 @@ async def sync_publisher_program(
723
717
publisher , self .publisher_program_key
724
718
)
725
719
726
- if not (await self . account_exists (publisher_config_account )):
720
+ if not (await account_exists (self . rpc_endpoint , publisher_config_account )):
727
721
size = 100048 # This size is for a buffer supporting 5000 price updates
728
722
lamports = await self .fetch_minimum_balance (size )
729
723
buffer_account , create_buffer_instruction = create_buffer_account (
0 commit comments