From f4e034a94368ba93c4e6cefc79e72d2db850920e Mon Sep 17 00:00:00 2001 From: Geoff Taylor Date: Wed, 23 Jun 2021 11:36:35 +0100 Subject: [PATCH] Added 'processed' commitment to client calls where it was missing. --- mango/accountinfo.py | 2 +- mango/instructions.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mango/accountinfo.py b/mango/accountinfo.py index 0d476ad..25012a5 100644 --- a/mango/accountinfo.py +++ b/mango/accountinfo.py @@ -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 diff --git a/mango/instructions.py b/mango/instructions.py index 6463b70..2429b49 100644 --- a/mango/instructions.py +++ b/mango/instructions.py @@ -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,