|
55 | 55 | "ACTIVATE_ACCOUNT": "/threefoldfoundation/activation_service/activate_account",
|
56 | 56 | }
|
57 | 57 |
|
| 58 | +_DEFAULTTRANSACTIONTIMEOUT = 30 |
| 59 | + |
58 | 60 |
|
59 | 61 | class Network(Enum):
|
60 | 62 | STD = "STD"
|
@@ -251,7 +253,7 @@ def _merge_account(self, address):
|
251 | 253 | # Step 3: Merge account
|
252 | 254 | transaction_builder.append_account_merge_op(self.address)
|
253 | 255 |
|
254 |
| - transaction_builder.set_timeout(30) |
| 256 | + transaction_builder.set_timeout(_DEFAULTTRANSACTIONTIMEOUT) |
255 | 257 | transaction = transaction_builder.build()
|
256 | 258 | transaction.sign(self.secret)
|
257 | 259 | server.submit_transaction(transaction)
|
@@ -323,6 +325,7 @@ def activate_account(self, destination_address, starting_balance="3.6"):
|
323 | 325 | base_fee=base_fee,
|
324 | 326 | )
|
325 | 327 | .append_create_account_op(destination=destination_address, starting_balance=starting_balance)
|
| 328 | + .set_timeout(_DEFAULTTRANSACTIONTIMEOUT) |
326 | 329 | .build()
|
327 | 330 | )
|
328 | 331 | transaction.sign(source_keypair)
|
@@ -396,7 +399,7 @@ def _change_trustline(self, asset_code, issuer, limit=None, secret=None):
|
396 | 399 | base_fee=base_fee,
|
397 | 400 | )
|
398 | 401 | .append_change_trust_op(Asset(asset_code, issuer), limit=limit)
|
399 |
| - .set_timeout(30) |
| 402 | + .set_timeout(_DEFAULTTRANSACTIONTIMEOUT) |
400 | 403 | .build()
|
401 | 404 | )
|
402 | 405 |
|
@@ -428,7 +431,7 @@ def transfer(
|
428 | 431 | memo_hash=None,
|
429 | 432 | fund_transaction=True,
|
430 | 433 | from_address=None,
|
431 |
| - timeout=30, |
| 434 | + timeout=_DEFAULTTRANSACTIONTIMEOUT, |
432 | 435 | sequence_number: int = None,
|
433 | 436 | sign: bool = True,
|
434 | 437 | retries: int = 5,
|
@@ -493,7 +496,7 @@ def _transfer(
|
493 | 496 | memo_hash=None,
|
494 | 497 | fund_transaction=True,
|
495 | 498 | from_address=None,
|
496 |
| - timeout=30, |
| 499 | + timeout=_DEFAULTTRANSACTIONTIMEOUT, |
497 | 500 | sequence_number: int = None,
|
498 | 501 | sign: bool = True,
|
499 | 502 | ):
|
@@ -818,7 +821,7 @@ def modify_signing_requirements(
|
818 | 821 | for public_key_signer in public_keys_signers:
|
819 | 822 | transaction_builder.append_ed25519_public_key_signer(public_key_signer, 1)
|
820 | 823 |
|
821 |
| - transaction_builder.set_timeout(30) |
| 824 | + transaction_builder.set_timeout(_DEFAULTTRANSACTIONTIMEOUT) |
822 | 825 | tx = transaction_builder.build()
|
823 | 826 | tx.sign(source_keypair)
|
824 | 827 |
|
@@ -975,7 +978,7 @@ def _manage_sell_order(
|
975 | 978 | buying_asset: str,
|
976 | 979 | amount: Union[str, decimal.Decimal],
|
977 | 980 | price: Union[str, decimal.Decimal],
|
978 |
| - timeout=30, |
| 981 | + timeout=_DEFAULTTRANSACTIONTIMEOUT, |
979 | 982 | offer_id=0,
|
980 | 983 | ):
|
981 | 984 | """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):
|
1068 | 1071 | source_account=account, network_passphrase=_NETWORK_PASSPHRASES[self.network.value], base_fee=base_fee
|
1069 | 1072 | )
|
1070 | 1073 | .append_manage_data_op(name, value)
|
1071 |
| - .set_timeout(30) |
| 1074 | + .set_timeout(_DEFAULTTRANSACTIONTIMEOUT) |
1072 | 1075 | .build()
|
1073 | 1076 | )
|
1074 | 1077 |
|
|
0 commit comments