Beispiel #1
0
import argparse
import sys
from fractions import Fraction

from quarkchain.env import DEFAULT_ENV
from quarkchain.evm.tests import new_statetest_utils, testutils

from quarkchain.evm.slogging import get_logger, configure_logging

logger = get_logger()
# customize VM log output to your needs
# hint: use 'py.test' with the '-s' option to dump logs to the console
if "--trace" in sys.argv:  # not default
    configure_logging(":trace")
    sys.argv.remove("--trace")

checker = new_statetest_utils.verify_state_test
place_to_check = "GeneralStateTests"


def test_state(filename, testname, testdata):
    logger.debug("running test:%r in %r" % (testname, filename))
    try:
        checker(testdata)
    except new_statetest_utils.EnvNotFoundException:
        pass


def exclude_func(filename, _, __):
    return (
        "stQuadraticComplexityTest" in filename
Beispiel #2
0
import json
import sys
from quarkchain.evm.tests import new_statetest_utils, testutils

from quarkchain.evm.slogging import get_logger, configure_logging
logger = get_logger()
# customize VM log output to your needs
# hint: use 'py.test' with the '-s' option to dump logs to the console
if '--trace' in sys.argv:  # not default
    configure_logging(':trace')
    sys.argv.remove('--trace')

checker = new_statetest_utils.verify_state_test
place_to_check = 'GeneralStateTests'


def test_state(filename, testname, testdata):
    logger.debug('running test:%r in %r' % (testname, filename))
    try:
        checker(testdata)
    except new_statetest_utils.EnvNotFoundException:
        pass


def exclude_func(filename, _, __):
    return (
        'stQuadraticComplexityTest' in filename or  # Takes too long
        'stMemoryStressTest' in filename or  # We run out of memory
        'MLOAD_Bounds.json' in filename or  # We run out of memory
        # we know how to pass: force address 3 to get deleted. TODO confer
        # with c++ best path foward.
Beispiel #3
0
import logging

from quarkchain.evm.slogging import get_logger, configure_logging
"""
slogging module used by ethereum is configured via a comman-separated string,
and each named logger will receive custom level (defaults to INFO)
examples:
':info'
':info,p2p.discovery:debug'

because of the way that configure_logging() is written, we cannot call configure_logging() after cluster_config is loaded;
so the best way to configure slogging is to change SLOGGING_CONFIGURATION here
"""
SLOGGING_CONFIGURATION = ":info"
configure_logging(SLOGGING_CONFIGURATION)

if __name__ == "__main__":
    logging.basicConfig()
    log = get_logger("test")
    log.warn("miner.new_block", block_hash="abcdef123", nonce=2234231)
Beispiel #4
0
import logging

from quarkchain.evm.slogging import get_logger, configure, configure_logging, getLogger

configure_logging(':info')

if __name__ == '__main__':
    logging.basicConfig()
    log = get_logger('test')
    log.warn('miner.new_block', block_hash='abcdef123', nonce=2234231)