Added 'processed' commitment to client calls where it was missing.

This commit is contained in:
Geoff Taylor 2021-06-23 11:36:35 +01:00
parent 206a95e39a
commit f4e034a943
2 changed files with 5 additions and 3 deletions

View File

@ -56,7 +56,7 @@ class AccountInfo:
@staticmethod
def load(context: Context, address: PublicKey) -> typing.Optional["AccountInfo"]:
response: RPCResponse = context.client.get_account_info(address)
response: RPCResponse = context.client.get_account_info(address, commitment=context.commitment)
result = context.unwrap_or_raise_exception(response)
if result["value"] is None:
return None

View File

@ -471,7 +471,8 @@ class CreateSplAccountInstructionBuilder(InstructionBuilder):
self.lamports: int = lamports
def build(self) -> TransactionInstruction:
minimum_balance_response = self.context.client.get_minimum_balance_for_rent_exemption(ACCOUNT_LEN)
minimum_balance_response = self.context.client.get_minimum_balance_for_rent_exemption(
ACCOUNT_LEN, commitment=self.context.commitment)
minimum_balance = self.context.unwrap_or_raise_exception(minimum_balance_response)
return create_account(
CreateAccountParams(self.wallet.address, self.address, self.lamports + minimum_balance, ACCOUNT_LEN, TOKEN_PROGRAM_ID))
@ -543,7 +544,8 @@ class CreateSerumOpenOrdersInstructionBuilder(InstructionBuilder):
self.open_orders_address: PublicKey = open_orders_address
def build(self) -> TransactionInstruction:
response = self.context.client.get_minimum_balance_for_rent_exemption(layouts.OPEN_ORDERS.sizeof())
response = self.context.client.get_minimum_balance_for_rent_exemption(
layouts.OPEN_ORDERS.sizeof(), commitment=self.context.commitment)
balanced_needed = self.context.unwrap_or_raise_exception(response)
instruction = make_create_account_instruction(
owner_address=self.wallet.address,