Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#366 on bucked error only check if there success sendings, if no raise (
  • Loading branch information
otselnik authored Dec 14, 2021
commit 521bd1543ff7878b0e7238c37d9b9cff0f8ac863
22 changes: 6 additions & 16 deletions proxy/common_neon/transaction_sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from .emulator_interactor import call_emulated
from .layouts import ACCOUNT_INFO_LAYOUT
from .neon_instruction import NeonInstruction
from .solana_interactor import SolanaInteractor, check_if_continue_returned, check_for_errors,\
check_if_program_exceeded_instructions, check_if_storage_is_empty_error
from .solana_interactor import SolanaInteractor, check_if_continue_returned, \
check_if_program_exceeded_instructions, check_for_errors
from ..environment import EVM_LOADER_ID
from ..plugin.eth_proto import Trx as EthTrx

Expand Down Expand Up @@ -425,7 +425,7 @@ def call_continue_step(self):

logger.debug("Step count {}".format(step_count))
try:
result = self.sender.send_measured_transaction(trx, self.eth_trx, 'ContinueV02')
result = self.sender.send_measured_transaction(trx, self.eth_trx, self.instruction_type)
return result
except SendTransactionError as err:
if check_if_program_exceeded_instructions(err.result):
Expand All @@ -445,25 +445,15 @@ def call_cancel(self):

def call_continue_bucked(self):
logger.debug("Send bucked combined: %s", self.instruction_type)
steps = self.steps

receipts = []
for index in range(math.ceil(self.steps_emulated/self.steps) + self.addition_count()):
try:
trx = self.make_combined_trx(steps, index)
trx = self.make_combined_trx(self.steps, index)
receipts.append(self.sender.send_transaction_unconfirmed(trx))
except SendTransactionError as err:
logger.error(f"Failed to call continue bucked, error: {err.result}")
if check_if_storage_is_empty_error(err.result):
pass
elif check_if_program_exceeded_instructions(err.result):
steps = int(steps * 90 / 100)
else:
raise
except Exception as err:
logger.debug(str(err))
if str(err).startswith('failed to get recent blockhash'):
pass
if len(receipts) > 0:
break
else:
raise

Expand Down