Skip to content

Commit a429299

Browse files
committed
Remove Trailing Slashes
1 parent 72540cb commit a429299

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

code-ch06/tx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ class TxFetcher:
2020
@classmethod
2121
def get_url(cls, testnet=False):
2222
if testnet:
23-
return 'http://testnet.programmingbitcoin.com'
23+
return 'https://blockstream.info/testnet/api'
2424
else:
25-
return 'http://mainnet.programmingbitcoin.com'
25+
return 'https://blockstream.info/api'
2626

2727
@classmethod
2828
def fetch(cls, tx_id, testnet=False, fresh=False):
2929
if fresh or (tx_id not in cls.cache):
30-
url = '{}/tx/{}.hex'.format(cls.get_url(testnet), tx_id)
30+
url = '{}/tx/{}/hex'.format(cls.get_url(testnet), tx_id)
3131
response = requests.get(url)
3232
try:
3333
raw = bytes.fromhex(response.text.strip())

code-ch07/tx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class TxFetcher:
2222
@classmethod
2323
def get_url(cls, testnet=False):
2424
if testnet:
25-
return 'https://blockstream.info/testnet/api/'
25+
return 'https://blockstream.info/testnet/api'
2626
else:
27-
return 'https://blockstream.info/api/'
27+
return 'https://blockstream.info/api'
2828

2929
@classmethod
3030
def fetch(cls, tx_id, testnet=False, fresh=False):

code-ch08/tx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class TxFetcher:
2222
@classmethod
2323
def get_url(cls, testnet=False):
2424
if testnet:
25-
return 'http://testnet.programmingbitcoin.com'
25+
return 'https://blockstream.info/testnet/api'
2626
else:
27-
return 'http://mainnet.programmingbitcoin.com'
27+
return 'https://blockstream.info/api'
2828

2929
@classmethod
3030
def fetch(cls, tx_id, testnet=False, fresh=False):

code-ch09/tx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class TxFetcher:
2222
@classmethod
2323
def get_url(cls, testnet=False):
2424
if testnet:
25-
return 'https://blockstream.info/testnet/api/'
25+
return 'https://blockstream.info/testnet/api'
2626
else:
27-
return 'https://blockstream.info/api/'
27+
return 'https://blockstream.info/api'
2828

2929
@classmethod
3030
def fetch(cls, tx_id, testnet=False, fresh=False):

code-ch10/tx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class TxFetcher:
2222
@classmethod
2323
def get_url(cls, testnet=False):
2424
if testnet:
25-
return 'http://testnet.programmingbitcoin.com'
25+
return 'https://blockstream.info/testnet/api'
2626
else:
27-
return 'http://mainnet.programmingbitcoin.com'
27+
return 'https://blockstream.info/api'
2828

2929
@classmethod
3030
def fetch(cls, tx_id, testnet=False, fresh=False):

code-ch12/tx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ class TxFetcher:
2222
@classmethod
2323
def get_url(cls, testnet=False):
2424
if testnet:
25-
return 'http://testnet.programmingbitcoin.com'
25+
return 'https://blockstream.info/testnet/api'
2626
else:
27-
return 'http://mainnet.programmingbitcoin.com'
27+
return 'https://blockstream.info/api'
2828

2929
@classmethod
3030
def fetch(cls, tx_id, testnet=False, fresh=False):
3131
if fresh or (tx_id not in cls.cache):
32-
url = '{}/tx/{}.hex'.format(cls.get_url(testnet), tx_id)
32+
url = '{}/tx/{}/hex'.format(cls.get_url(testnet), tx_id)
3333
response = requests.get(url)
3434
try:
3535
raw = bytes.fromhex(response.text.strip())

code-ch13/tx.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
class TxFetcher:
2020
cache = {}
21-
21+
2222
@classmethod
2323
def get_url(cls, testnet=False):
2424
if testnet:
25-
return 'https://blockstream.info/testnet/api/'
25+
return 'https://blockstream.info/testnet/api'
2626
else:
27-
return 'https://blockstream.info/api/'
27+
return 'https://blockstream.info/api'
2828

2929
@classmethod
3030
def fetch(cls, tx_id, testnet=False, fresh=False):

0 commit comments

Comments
 (0)