Skip to content

Commit adc8431

Browse files
committed
Merge branch 'defconradio-core_default_nsequence'
2 parents 041a801 + a1e7716 commit adc8431

File tree

7 files changed

+31
-30
lines changed

7 files changed

+31
-30
lines changed

bitcoinutils/constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@
6969
DEFAULT_TX_LOCKTIME = b"\x00\x00\x00\x00"
7070

7171
EMPTY_TX_SEQUENCE = b"\x00\x00\x00\x00"
72-
DEFAULT_TX_SEQUENCE = b"\xff\xff\xff\xff"
72+
DEFAULT_TX_SEQUENCE = b"\xfd\xff\xff\xff"
7373
ABSOLUTE_TIMELOCK_SEQUENCE = b"\xfe\xff\xff\xff"
74+
FINAL_TX_SEQUENCE = b"\xff\xff\xff\xff"
7475

7576
REPLACE_BY_FEE_SEQUENCE = b"\x01\x00\x00\x00"
7677

@@ -96,4 +97,4 @@
9697
"0b110907" : "testnet",
9798
"fabfb5da" : "regtest",
9899
"0a03cf40" : "signet"
99-
}
100+
}

tests/test_non_std_txs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def setUp(self):
2424
setup("testnet")
2525
# values for testing create non std tx
2626
self.txin = TxInput(
27-
"e2d08a63a540000222d6a92440436375d8b1bc89a2638dc5366833804287c83f", 1
27+
"e2d08a63a540000222d6a92440436375d8b1bc89a2638dc5366833804287c83f", 1, sequence=b"\xff\xff\xff\xff"
2828
)
2929
self.to_addr = P2pkhAddress("msXP94TBncQ9usP6oZNpGweE24biWjJs2d")
3030
self.sk = PrivateKey("cMahea7zqjxrtgAbB7LSGbcQUr1uX1ojuat9jZodMN87JcbXMTcA")
@@ -44,7 +44,7 @@ def setUp(self):
4444

4545
# values for testing create non std tx
4646
self.txin_spend = TxInput(
47-
"4d9a6baf45d4b57c875fe83d5e0834568eae4b5ef6e61d13720ef6685168e663", 0
47+
"4d9a6baf45d4b57c875fe83d5e0834568eae4b5ef6e61d13720ef6685168e663", 0, sequence=b"\xff\xff\xff\xff"
4848
)
4949
self.txin_spend.script_sig = Script(["OP_2", "OP_3"])
5050
self.txout_spend = TxOutput(

tests/test_p2pkh_txs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def setUp(self):
3333
# values for testing unsigned tx, signed tx all, signed tx with low s,
3434
# sighash none
3535
self.txin = TxInput(
36-
"fb48f4e23bf6ddf606714141ac78c3e921c8c0bebeb7c8abb2c799e9ff96ce6c", 0
36+
"fb48f4e23bf6ddf606714141ac78c3e921c8c0bebeb7c8abb2c799e9ff96ce6c", 0, sequence=b"\xff\xff\xff\xff"
3737
)
3838
self.addr = P2pkhAddress("n4bkvTyU1dVdzsrhWBqBw8fEMbHjJvtmJR")
3939
self.txout = TxOutput(
@@ -99,10 +99,10 @@ def setUp(self):
9999
# values for testing sighash single and sighash all/none/single with
100100
# anyonecanpay
101101
self.sig_txin1 = TxInput(
102-
"76464c2b9e2af4d63ef38a77964b3b77e629dddefc5cb9eb1a3645b1608b790f", 0
102+
"76464c2b9e2af4d63ef38a77964b3b77e629dddefc5cb9eb1a3645b1608b790f", 0, sequence=b"\xff\xff\xff\xff"
103103
)
104104
self.sig_txin2 = TxInput(
105-
"76464c2b9e2af4d63ef38a77964b3b77e629dddefc5cb9eb1a3645b1608b790f", 1
105+
"76464c2b9e2af4d63ef38a77964b3b77e629dddefc5cb9eb1a3645b1608b790f", 1, sequence=b"\xff\xff\xff\xff"
106106
)
107107
self.sig_from_addr1 = P2pkhAddress("n4bkvTyU1dVdzsrhWBqBw8fEMbHjJvtmJR")
108108
self.sig_from_addr2 = P2pkhAddress("mmYNBho9BWQB2dSniP1NJvnPoj5EVWw89w")

tests/test_p2sh_txs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TestCreateP2shTransaction(unittest.TestCase):
2424
def setUp(self):
2525
setup("testnet")
2626
self.txin = TxInput(
27-
"76464c2b9e2af4d63ef38a77964b3b77e629dddefc5cb9eb1a3645b1608b790f", 0
27+
"76464c2b9e2af4d63ef38a77964b3b77e629dddefc5cb9eb1a3645b1608b790f", 0, sequence=b"\xff\xff\xff\xff"
2828
)
2929
self.from_addr = P2pkhAddress("n4bkvTyU1dVdzsrhWBqBw8fEMbHjJvtmJR")
3030
self.sk = PrivateKey("cTALNpTpRbbxTCJ2A5Vq88UxT44w1PE2cYqiB3n4hRvzyCev1Wwo")
@@ -47,7 +47,7 @@ def setUp(self):
4747
)
4848

4949
self.txin_spend = TxInput(
50-
"7db363d5a7fabb64ccce154e906588f1936f34481223ea8c1f2c935b0a0c945b", 0
50+
"7db363d5a7fabb64ccce154e906588f1936f34481223ea8c1f2c935b0a0c945b", 0, sequence=b"\xff\xff\xff\xff"
5151
)
5252
# self.p2pk_sk , self.p2pk_redeem_script from above
5353
self.to_addr = self.from_addr

tests/test_p2tr_txs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def setUp(self):
3535
self.priv02 = PrivateKey("cV3R88re3AZSBnWhBBNdiCKTfwpMKkYYjdiR13HQzsU7zoRNX7JL")
3636
self.pub02 = self.priv02.get_public_key()
3737
self.txin02 = TxInput(
38-
"7b6412a0eed56338731e83c606f13ebb7a3756b3e4e1dbbe43a7db8d09106e56", 1
38+
"7b6412a0eed56338731e83c606f13ebb7a3756b3e4e1dbbe43a7db8d09106e56", 1, sequence=b"\xff\xff\xff\xff"
3939
)
4040
self.amount02 = to_satoshis(0.00005)
4141
self.script_pubkey02 = Script(["OP_1", self.pub02.to_taproot_hex()[0]])
@@ -62,7 +62,7 @@ def setUp(self):
6262
self.priv03 = PrivateKey("cNxX8M7XU8VNa5ofd8yk1eiZxaxNrQQyb7xNpwAmsrzEhcVwtCjs")
6363
self.pub03 = self.priv03.get_public_key()
6464
self.txin03 = TxInput(
65-
"2a28f8bd8ba0518a86a390da310073a30b7df863d04b42a9c487edf3a8b113af", 1
65+
"2a28f8bd8ba0518a86a390da310073a30b7df863d04b42a9c487edf3a8b113af", 1, sequence=b"\xff\xff\xff\xff"
6666
)
6767
self.amount02 = to_satoshis(0.00005)
6868
self.script_pubkey03 = Script(["OP_1", self.pub03.to_taproot_hex()[0]])
@@ -211,7 +211,7 @@ def setUp(self):
211211
self.from_pub2 = self.from_priv2.get_public_key()
212212
self.from_address2 = self.from_pub2.get_taproot_address([self.tr_script_p2pk1])
213213
self.tx_in2 = TxInput(
214-
"3d4c9d73c4c65772e645ff26493590ae4913d9c37125b72398222a553b73fa66", 0
214+
"3d4c9d73c4c65772e645ff26493590ae4913d9c37125b72398222a553b73fa66", 0, sequence=b"\xff\xff\xff\xff",
215215
)
216216

217217
self.to_priv2 = PrivateKey(
@@ -307,7 +307,7 @@ def setUp(self):
307307
)
308308

309309
self.tx_in = TxInput(
310-
"808ec85db7b005f1292cea744b24e9d72ba4695e065e2d968ca17744b5c5c14d", 0
310+
"808ec85db7b005f1292cea744b24e9d72ba4695e065e2d968ca17744b5c5c14d", 0, sequence=b"\xff\xff\xff\xff"
311311
)
312312

313313
self.to_priv = PrivateKey(
@@ -393,7 +393,7 @@ def setUp(self):
393393
self.from_address = self.from_pub.get_taproot_address(self.scripts)
394394

395395
self.tx_in = TxInput(
396-
"9b8a01d0f333b2440d4d305d26641e14e0e1932ebc3c4f04387c0820fada87d3", 0
396+
"9b8a01d0f333b2440d4d305d26641e14e0e1932ebc3c4f04387c0820fada87d3", 0, sequence=b"\xff\xff\xff\xff"
397397
)
398398

399399
self.to_priv = PrivateKey(

tests/test_p2wpkh_txs.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ def setUp(self):
4141

4242
# P2PKH to P2WPKH
4343
self.txin1 = TxInput(
44-
"5a7b3aaa66d6b7b7abcdc9f1d05db4eee94a700297a319e19454e143875e1078", 0
44+
"5a7b3aaa66d6b7b7abcdc9f1d05db4eee94a700297a319e19454e143875e1078", 0, sequence=b"\xff\xff\xff\xff"
4545
)
4646
self.txout1 = TxOutput(
4747
to_satoshis(0.0099), self.p2wpkh_addr.to_script_pub_key()
4848
)
4949

5050
# P2WPKH to P2PKH
5151
self.txin_spend = TxInput(
52-
"b3ca1c4cc778380d1e5376a5517445104e46e97176e40741508a3b07a6483ad3", 0
52+
"b3ca1c4cc778380d1e5376a5517445104e46e97176e40741508a3b07a6483ad3", 0, sequence=b"\xff\xff\xff\xff"
5353
)
5454
self.txin_spend_amount = to_satoshis(0.0099)
5555
self.txout2 = TxOutput(to_satoshis(0.0098), self.p2pkh_addr.to_script_pub_key())
@@ -65,20 +65,20 @@ def setUp(self):
6565

6666
# P2WPKH P2PKH to P2PKH
6767
self.txin_spend_p2pkh = TxInput(
68-
"1e2a5279c868d61fb2ff0b1c2b04aa3eff02cd74952a8b4e799532635a9132cc", 0
68+
"1e2a5279c868d61fb2ff0b1c2b04aa3eff02cd74952a8b4e799532635a9132cc", 0, sequence=b"\xff\xff\xff\xff"
6969
)
7070
self.txin_spend_p2pkh_amount = to_satoshis(0.01)
7171

7272
self.txin_spend_p2wpkh = TxInput(
73-
"fff39047310fbf04bdd0e0bc75dde4267ae4d25219d8ad95e0ca1cee907a60da", 0
73+
"fff39047310fbf04bdd0e0bc75dde4267ae4d25219d8ad95e0ca1cee907a60da", 0, sequence=b"\xff\xff\xff\xff"
7474
)
7575
self.txin_spend_p2wpkh_amount = to_satoshis(0.0095)
7676

7777
self.txout3 = TxOutput(to_satoshis(0.0194), self.p2pkh_addr.to_script_pub_key())
7878

7979
# SIGHASH NONE type send
8080
self.txin1_signone = TxInput(
81-
"fb4c338a00a75d73f9a6bd203ed4bd8884edeb111fac25a7946d5df6562f1942", 0
81+
"fb4c338a00a75d73f9a6bd203ed4bd8884edeb111fac25a7946d5df6562f1942", 0, sequence=b"\xff\xff\xff\xff"
8282
)
8383
self.txin1_signone_amount = to_satoshis(0.01)
8484

@@ -91,7 +91,7 @@ def setUp(self):
9191

9292
# SIGHASH SINGLE type send
9393
self.txin1_sigsingle = TxInput(
94-
"b04909d4b5239a56d676c1d9d722f325a86878c9aa535915aa0df97df47cedeb", 0
94+
"b04909d4b5239a56d676c1d9d722f325a86878c9aa535915aa0df97df47cedeb", 0, sequence=b"\xff\xff\xff\xff"
9595
)
9696
self.txin1_sigsingle_amount = to_satoshis(0.0193)
9797

@@ -104,12 +104,12 @@ def setUp(self):
104104

105105
# SIGHASH_ALL | SIGHASH_ANYONECANPAY type send
106106
self.txin1_siganyonecanpay_all = TxInput(
107-
"f67e97a2564dceed405e214843e3c954b47dd4f8b26ea48f82382f51f7626036", 0
107+
"f67e97a2564dceed405e214843e3c954b47dd4f8b26ea48f82382f51f7626036", 0, sequence=b"\xff\xff\xff\xff"
108108
)
109109
self.txin1_siganyonecanpay_all_amount = to_satoshis(0.0018)
110110

111111
self.txin2_siganyonecanpay_all = TxInput(
112-
"f4afddb77cd11a79bed059463085382c50d60c7f9e4075d8469cfe60040f68eb", 0
112+
"f4afddb77cd11a79bed059463085382c50d60c7f9e4075d8469cfe60040f68eb", 0, sequence=b"\xff\xff\xff\xff"
113113
)
114114
self.txin2_siganyonecanpay_all_amount = to_satoshis(0.0018)
115115

@@ -122,12 +122,12 @@ def setUp(self):
122122

123123
# SIGHASH_NONE | SIGHASH_ANYONECANPAY type send
124124
self.txin1_siganyonecanpay_none = TxInput(
125-
"d2ae5d4a3f390f108769139c9b5757846be6693b785c4e21eab777eec7289095", 0
125+
"d2ae5d4a3f390f108769139c9b5757846be6693b785c4e21eab777eec7289095", 0, sequence=b"\xff\xff\xff\xff"
126126
)
127127
self.txin1_siganyonecanpay_none_amount = to_satoshis(0.009)
128128

129129
self.txin2_siganyonecanpay_none = TxInput(
130-
"ee5062d426677372e6de96e2eb47d572af5deaaef3ef225f3179dfa1ece3f4f5", 0
130+
"ee5062d426677372e6de96e2eb47d572af5deaaef3ef225f3179dfa1ece3f4f5", 0, sequence=b"\xff\xff\xff\xff"
131131
)
132132
self.txin2_siganyonecanpay_none_amount = to_satoshis(0.007)
133133

@@ -140,7 +140,7 @@ def setUp(self):
140140

141141
# SIGHASH_SINGLE | SIGHASH_ANYONECANPAY type send
142142
self.txin1_siganyonecanpay_single = TxInput(
143-
"c7bb5672266c8a5b64fe91e953a9e23e3206e3b1a2ddc8e5999b607b82485042", 0
143+
"c7bb5672266c8a5b64fe91e953a9e23e3206e3b1a2ddc8e5999b607b82485042", 0, sequence=b"\xff\xff\xff\xff"
144144
)
145145
self.txin1_siganyonecanpay_single_amount = to_satoshis(0.01)
146146

tests/test_p2wsh_txs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ def setUp(self):
4848

4949
# P2PKH to P2WSH
5050
self.txin1 = TxInput(
51-
"6e9a0692ed4b3328909d66d41531854988dc39edba5df186affaefda91824e69", 0
51+
"6e9a0692ed4b3328909d66d41531854988dc39edba5df186affaefda91824e69", 0, sequence=b"\xff\xff\xff\xff"
5252
)
5353
self.txout1 = TxOutput(to_satoshis(0.0097), self.p2wsh_addr.to_script_pub_key())
5454

5555
# P2WSH to P2PKH
5656
self.txin_spend = TxInput(
57-
"6233aca9f2d6165da2d7b4e35d73b039a22b53f58ce5af87dddee7682be937ea", 0
57+
"6233aca9f2d6165da2d7b4e35d73b039a22b53f58ce5af87dddee7682be937ea", 0, sequence=b"\xff\xff\xff\xff"
5858
)
5959
self.txin_spend_amount = to_satoshis(0.0097)
6060
self.txout2 = TxOutput(to_satoshis(0.0096), self.p2pkh_addr.to_script_pub_key())
@@ -63,17 +63,17 @@ def setUp(self):
6363
# Multiple input multiple output
6464
# P2PKH UTXO
6565
self.txin1_multiple = TxInput(
66-
"24d949f8c77d7fc0cd09c8d5fccf7a0249178c16170c738da19f6c4b176c9f4b", 0
66+
"24d949f8c77d7fc0cd09c8d5fccf7a0249178c16170c738da19f6c4b176c9f4b", 0, sequence=b"\xff\xff\xff\xff"
6767
)
6868
self.txin1_multiple_amount = to_satoshis(0.005)
6969
# P2WSH UTXO
7070
self.txin2_multiple = TxInput(
71-
"65f4d69c91a8de54dc11096eaa315e84ef91a389d1d1c17a691b72095100a3a4", 0
71+
"65f4d69c91a8de54dc11096eaa315e84ef91a389d1d1c17a691b72095100a3a4", 0, sequence=b"\xff\xff\xff\xff"
7272
)
7373
self.txin2_multiple_amount = to_satoshis(0.0069)
7474
# P2WPKH UTXO
7575
self.txin3_multiple = TxInput(
76-
"6c8fc6453a2a3039c2b5b55dcc59587e8b0afa52f92607385b5f4c7e84f38aa2", 0
76+
"6c8fc6453a2a3039c2b5b55dcc59587e8b0afa52f92607385b5f4c7e84f38aa2", 0, sequence=b"\xff\xff\xff\xff"
7777
)
7878
self.txin3_multiple_amount = to_satoshis(0.0079)
7979

0 commit comments

Comments
 (0)