Skip to content

Commit 598d8fa

Browse files
authored
Merge pull request #3422 from threefoldtech/development_fix3421
Set transaction timeout on stellar account activation
2 parents 7d1a7f7 + 3ad6503 commit 598d8fa

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

jumpscale/clients/stellar/stellar.py

+10-7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
"ACTIVATE_ACCOUNT": "/threefoldfoundation/activation_service/activate_account",
5656
}
5757

58+
_DEFAULTTRANSACTIONTIMEOUT = 30
59+
5860

5961
class Network(Enum):
6062
STD = "STD"
@@ -251,7 +253,7 @@ def _merge_account(self, address):
251253
# Step 3: Merge account
252254
transaction_builder.append_account_merge_op(self.address)
253255

254-
transaction_builder.set_timeout(30)
256+
transaction_builder.set_timeout(_DEFAULTTRANSACTIONTIMEOUT)
255257
transaction = transaction_builder.build()
256258
transaction.sign(self.secret)
257259
server.submit_transaction(transaction)
@@ -323,6 +325,7 @@ def activate_account(self, destination_address, starting_balance="3.6"):
323325
base_fee=base_fee,
324326
)
325327
.append_create_account_op(destination=destination_address, starting_balance=starting_balance)
328+
.set_timeout(_DEFAULTTRANSACTIONTIMEOUT)
326329
.build()
327330
)
328331
transaction.sign(source_keypair)
@@ -396,7 +399,7 @@ def _change_trustline(self, asset_code, issuer, limit=None, secret=None):
396399
base_fee=base_fee,
397400
)
398401
.append_change_trust_op(Asset(asset_code, issuer), limit=limit)
399-
.set_timeout(30)
402+
.set_timeout(_DEFAULTTRANSACTIONTIMEOUT)
400403
.build()
401404
)
402405

@@ -428,7 +431,7 @@ def transfer(
428431
memo_hash=None,
429432
fund_transaction=True,
430433
from_address=None,
431-
timeout=30,
434+
timeout=_DEFAULTTRANSACTIONTIMEOUT,
432435
sequence_number: int = None,
433436
sign: bool = True,
434437
retries: int = 5,
@@ -493,7 +496,7 @@ def _transfer(
493496
memo_hash=None,
494497
fund_transaction=True,
495498
from_address=None,
496-
timeout=30,
499+
timeout=_DEFAULTTRANSACTIONTIMEOUT,
497500
sequence_number: int = None,
498501
sign: bool = True,
499502
):
@@ -818,7 +821,7 @@ def modify_signing_requirements(
818821
for public_key_signer in public_keys_signers:
819822
transaction_builder.append_ed25519_public_key_signer(public_key_signer, 1)
820823

821-
transaction_builder.set_timeout(30)
824+
transaction_builder.set_timeout(_DEFAULTTRANSACTIONTIMEOUT)
822825
tx = transaction_builder.build()
823826
tx.sign(source_keypair)
824827

@@ -975,7 +978,7 @@ def _manage_sell_order(
975978
buying_asset: str,
976979
amount: Union[str, decimal.Decimal],
977980
price: Union[str, decimal.Decimal],
978-
timeout=30,
981+
timeout=_DEFAULTTRANSACTIONTIMEOUT,
979982
offer_id=0,
980983
):
981984
"""Places/Deletes a selling order for amount `amount` of `selling_asset` for `buying_asset` with the price of `price`
@@ -1068,7 +1071,7 @@ def set_data_entry(self, name: str, value: str, address: str = None):
10681071
source_account=account, network_passphrase=_NETWORK_PASSPHRASES[self.network.value], base_fee=base_fee
10691072
)
10701073
.append_manage_data_op(name, value)
1071-
.set_timeout(30)
1074+
.set_timeout(_DEFAULTTRANSACTIONTIMEOUT)
10721075
.build()
10731076
)
10741077

0 commit comments

Comments
 (0)