Skip to content

Instantly share code, notes, and snippets.

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)
}
}
# 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,
** playtime (comedy)
* rope
* 1917
* Westworld (1973)
* 10 cloverfield lane
* rififi
* cool hand luke
do the right thing
a most wanted man
the rover
"""Types used to represent transaction and its states.
Each state of a transaction is described by a different wrapper dataclass, this
is used to introduce new fields in a type safe manner, and to enforce correct
usage.
Transactions are by design immutable and don't have access in their field to
objects that do IO, that is why the RPC class is given as an argument to each
method, when necessary.
"""
travis_fold:start:worker_info
Worker information
hostname: fd103e0e-d1ca-4351-b2ff-f17423c6293a@1.production-1-worker-org-gce-n827
version: v4.5.1 https://github.com/travis-ci/worker/tree/ce724b775b2d5dc4c57b849f4cf4a123e1e34d70
instance: travis-job-3509424d-b09d-4880-b2ee-5febc8d3bab5 travis-ci-sardonyx-xenial-1539708025-01f27ab (via amqp)
startup: 11.094853817s
travis_fold:end:worker_info
travis_fold:start:system_info
Build system information
Build language: python
from gevent.monkey import patch_all
from gevent.lock import Semaphore
patch_all()
import aiogevent
import asyncio
import gevent
import asyncio
import json
import os
import statistics
from multiprocessing.pool import Pool
import aiohttp
URL = "http://geth.mainnet.ethnodes.brainbot.com:8545"
HEADERS = {
@hackaugusto
hackaugusto / event_fetching.py
Created April 17, 2020 10:54
time response times for geth get logs requests.
import gevent.monkey # isort:skip
gevent.monkey.patch_all() # isort:skip
import statistics
import time
import gevent
from web3 import HTTPProvider, Web3
@hackaugusto
hackaugusto / t.py
Created April 14, 2020 15:53
eth_getLogs response time measurment
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
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.