Skip to content

Commit

Permalink
refactor: generate V1 transactions by default (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat authored Jun 18, 2020
1 parent d8fd380 commit c5d4511
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions stellar_sdk/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class Transaction:
:param memo: The memo being sent with the transaction, being
represented as one of the subclasses of the
:class:`Memo <stellar_sdk.memo.Memo>` object.
:param v1: Temporary feature flag to allow alpha testing of Stellar Protocol 13 transactions.
We will remove this once all transactions are supposed to be v1.
:param v1: When this value is set to True, V1 transactions will be generated,
otherwise V0 transactions will be generated.
See `CAP-0015 <https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md>`_ for more information.
"""

Expand All @@ -60,7 +60,7 @@ def __init__(
operations: List[Operation],
memo: Memo = None,
time_bounds: TimeBounds = None,
v1: bool = False,
v1: bool = True,
) -> None:

# if not operations:
Expand Down
6 changes: 3 additions & 3 deletions stellar_sdk/transaction_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class TransactionBuilder:
Defaults to **Test SDF Network ; September 2015**.
:param base_fee: Base fee in stroops. The network base fee is obtained by default from the latest ledger.
Transaction fee is equal to base fee times number of operations in this transaction.
:param v1: Temporary feature flag to allow alpha testing of Stellar Protocol 13 transactions.
We will remove this once all transactions are supposed to be v1.
:param v1: When this value is set to True, V1 transactions will be generated,
otherwise V0 transactions will be generated.
See `CAP-0015 <https://github.com/stellar/stellar-protocol/blob/master/core/cap-0015.md>`_ for more information.
"""

Expand All @@ -53,7 +53,7 @@ def __init__(
source_account: Account,
network_passphrase: str = Network.TESTNET_NETWORK_PASSPHRASE,
base_fee: int = 100,
v1: bool = False,
v1: bool = True,
):
self.source_account: Account = source_account
self.base_fee: int = base_fee
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transaction_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_to_xdr_v0(self):
"GDF5O4OWEMVBY5FLDHWA5RZTYSV2U276XGKZZ6VSHDDR3THSQ6OQS7UM", sequence
)
builder = TransactionBuilder(
source, Network.TESTNET_NETWORK_PASSPHRASE, base_fee=150
source, Network.TESTNET_NETWORK_PASSPHRASE, base_fee=150, v1=False
)
builder.add_text_memo("Stellar Python SDK")
builder.add_time_bounds(1565590000, 1565600000)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transaction_envelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_to_xdr_v0(self):
asset = Asset.native()
time_bounds = TimeBounds(12345, 56789)
ops = [Payment(destination, asset, amount), ManageData("hello", "world")]
tx = Transaction(source, sequence, fee, ops, memo, time_bounds)
tx = Transaction(source, sequence, fee, ops, memo, time_bounds, False)
te = TransactionEnvelope(tx, Network.PUBLIC_NETWORK_PASSPHRASE)
assert binascii.hexlify(te.hash()).decode() == te.hash_hex()
te.sign(source)
Expand Down

0 comments on commit c5d4511

Please sign in to comment.