Skip to content

Commit cfc85fc

Browse files
committed
add testnet support to sending bocs via toncenter
1 parent 9846c73 commit cfc85fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

mytoncore.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,11 @@ def send_boc_toncenter(self, file_path: str):
14451445
boc = f.read()
14461446
boc_b64 = base64.b64encode(boc).decode("utf-8")
14471447
data = {"boc": boc_b64}
1448-
result = requests.post(url='https://toncenter.com/api/v2/sendBoc', json=data)
1448+
if self.GetNetworkName() == 'testnet':
1449+
url = 'https://testnet.toncenter.com/api/v2/sendBoc'
1450+
else:
1451+
url = 'https://toncenter.com/api/v2/sendBoc'
1452+
result = requests.post(url=url, json=data)
14491453
if result.status_code != 200:
14501454
local.add_log(f'Failed to send boc to toncenter: {result.content}', 'info')
14511455
return False

0 commit comments

Comments
 (0)