Skip to content

Commit de1213b

Browse files
author
John Doe
committed
fix timestamp parsing in example
1 parent 3acb308 commit de1213b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test_upload_bundlr.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@
1616
txid = result['id']
1717

1818
peer = Peer()
19-
current_block = peer.current_block()
20-
eta = current_block['timestamp'] + (result['block'] - current_block['height']) * 60 * 2
19+
20+
# bundlr used to return an expected block height but now seems to return some timestamp 2022-11
21+
# communicate with bundlr for details on their api.
22+
#current_block = peer.current_block()
23+
#eta = current_block['timestamp'] + (result['block'] - current_block['height']) * 60 * 2
24+
eta = int(result['timestamp']/1000)
25+
2126
eta = datetime.datetime.fromtimestamp(eta)
2227

23-
print(f'{peer.api_url}/{result["id"]} should be mined by {eta.isoformat()} block {result["block"]} or so, at the very latest.')
28+
print(f'{peer.api_url}/{result["id"]} timestamp={eta.isoformat()}')

0 commit comments

Comments
 (0)