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
use std::fmt::Display; | |
use std::fmt::Formatter; | |
struct A(u64); | |
impl Display for A { | |
fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), std::fmt::Error> { | |
write!(fmt, "{}", self.0) | |
} | |
} |
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
# Copyright 2021 Aiven Oy https://aiven.io | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, |
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 gevent.monkey import patch_all | |
from gevent.lock import Semaphore | |
patch_all() | |
import aiogevent | |
import asyncio | |
import gevent | |
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 asyncio | |
import json | |
import os | |
import statistics | |
from multiprocessing.pool import Pool | |
import aiohttp | |
URL = "http://geth.mainnet.ethnodes.brainbot.com:8545" | |
HEADERS = { |
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 gevent.monkey # isort:skip | |
gevent.monkey.patch_all() # isort:skip | |
import statistics | |
import time | |
import gevent | |
from web3 import HTTPProvider, Web3 |
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
** playtime (comedy) | |
* rope | |
* 1917 | |
* Westworld (1973) | |
* 10 cloverfield lane | |
* rififi | |
* cool hand luke | |
do the right thing | |
a most wanted man | |
the rover |
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 | |
import raiden_contracts.constants | |
from eth_utils import to_checksum_address | |
from raiden_contracts.contract_manager import (ContractManager, | |
contracts_precompiled_path) | |
from web3 import HTTPProvider, Web3 | |
from raiden.blockchain.events import BlockchainEvents, filters_to_rpc | |
from raiden.network.rpc.client import JSONRPCClient |
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 hashlib | |
import json | |
import math | |
import random | |
from collections import defaultdict | |
from dataclasses import dataclass, field | |
from typing import Any, Dict, List, Optional, Tuple | |
# Percentage of transfers that should be reused when creating a new block with | |
# sibilings. |
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() | |
NewerOlder