This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
setup = "from eth_utils import keccak" | |
run = "keccak(b'')" | |
print("keccak") | |
print(timeit.timeit(run, setup)) | |
setup = "from eth_utils import to_checksum_address" | |
run = f"to_checksum_address(b'00000000000000000000')" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import signal | |
import gevent | |
import gevent.event | |
stop_event = gevent.event.AsyncResult() | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
import datetime | |
first = None | |
largest_gap = datetime.timedelta(0) | |
start = None | |
end = None | |
for l in sys.stdin: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from dataclasses import dataclass, field | |
from typing import List | |
import gevent | |
@dataclass | |
class Idle: | |
interval: float |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO [12-13|12:15:20.802] Maximum peer count ETH=50 LES=0 total=50 | |
INFO [12-13|12:15:20.802] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory" | |
INFO [12-13|12:15:20.808] Starting peer-to-peer node instance=Geth/v1.9.9-stable-01744997/linux-amd64/go1.13.5 | |
INFO [12-13|12:15:20.808] Allocated trie memory caches clean=256.00MiB dirty=256.00MiB | |
INFO [12-13|12:15:20.808] Allocated cache and file handles database=/tmp/pytest-of-hack/pytest-4/test_remote_transaction_with_z0/0x33c377/geth/chaindata cache=512.00MiB handles=262144 | |
INFO [12-13|12:15:20.813] Opened ancient database database=/tmp/pytest-of-hack/pytest-4/test_remote_transaction_with_z0/0x33c377/geth/chaindata/ancient | |
INFO [12-13|12:15:20.813] Initialised chain configuration config="{ChainID: 337 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: <nil>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO [12-13|12:15:21.182] Maximum peer count ETH=50 LES=0 total=50 | |
INFO [12-13|12:15:21.182] Smartcard socket not found, disabling err="stat /run/pcscd/pcscd.comm: no such file or directory" | |
INFO [12-13|12:15:21.215] Starting peer-to-peer node instance=Geth/v1.9.9-stable-01744997/linux-amd64/go1.13.5 | |
INFO [12-13|12:15:21.215] Allocated trie memory caches clean=256.00MiB dirty=256.00MiB | |
INFO [12-13|12:15:21.219] Allocated cache and file handles database=/tmp/pytest-of-hack/pytest-4/test_remote_transaction_with_z0/0x332f15/geth/chaindata cache=512.00MiB handles=262144 | |
INFO [12-13|12:15:21.269] Opened ancient database database=/tmp/pytest-of-hack/pytest-4/test_remote_transaction_with_z0/0x332f15/geth/chaindata/ancient | |
INFO [12-13|12:15:21.269] Initialised chain configuration config="{ChainID: 337 Homestead: 0 DAO: <nil> DAOSupport: false EIP150: 0 EIP155: 0 EIP158: 0 Byzantium: 0 Constantinople: 0 Petersburg: 0 Istanbul: <nil>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import shlex | |
import subprocess | |
import os.path | |
import http | |
import http.server | |
import socketserver | |
import urllib.parse | |
import ssl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Generic, TypeVar, cast | |
from typing_extensions import Literal | |
T = TypeVar("T") | |
class A(Generic[T]): | |
def f1(self: "A[Literal[1]]") -> "A[Literal[2]]": | |
return cast(A[Literal[2]], self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"node": "0bae0289", | |
"registry_address": "0xbfa863Ac58a3E0A82B58a8e958F2752Bfb573388", | |
"token_address": "0x98a345f06e3A5DFe28EE0af38dd0780b4C0ed73B", | |
"partner_address": "0xce936b7FEe88b48267EbD82Ad7897Aeb52803A7F", | |
"total_deposit": 1e+22, | |
"event": "Depositing to new channel", | |
"logger": "raiden.api.rest", | |
"level": "debug", | |
"timestamp": "2018-12-07 03:52:49.882027" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[('Minted', 500000), | |
('Approval', 500000) | |
('Transfer', 5000), | |
('Transfer', 5000), | |
('Transfer', 5000), | |
('Transfer', 5000), | |
('Transfer', 5000), | |
('Transfer', 5000), | |
('Transfer', 5000), | |
('Transfer', 5000), |