예제 #1
0
파일: simulator.py 프로젝트: pirapira/hive
def main(args):

    print("Simulator started\n")

    if 'HIVE_SIMULATOR' not in os.environ:
        print("Running in TEST-mode")
        return test()

    hivesim = os.environ['HIVE_SIMULATOR']
    print("Hive simulator: %s\n" % hivesim)
    hive = hivemodel.HiveAPI(hivesim)

    status = hivemodel.BlockTestExecutor(
        hive_api=hive,
        testfiles=utils.getFiles("./tests/BlockchainTests"),
        rules=Rules.RULES_FRONTIER).run()

    status = hivemodel.BlockTestExecutor(
        hive_api=hive,
        testfiles=utils.getFiles("./tests/BlockchainTests/EIP150"),
        rules=Rules.RULES_TANGERINE).run()

    status = hivemodel.BlockTestExecutor(
        hive_api=hive,
        testfiles=utils.getFiles("./tests/BlockchainTests/Homestead"),
        rules=Rules.RULES_HOMESTEAD).run()

    status = hivemodel.BlockTestExecutor(
        hive_api=hive,
        testfiles=utils.getFiles("./tests/BlockchainTests/TestNetwork"),
        rules=Rules.RULES_TRANSITIONNET).run()

    status = hivemodel.BlockTestExecutor(
        hive_api=hive,
        testfiles=utils.getFilesRecursive("./tests/BlockchainTests/GeneralStateTests/"),
        rules=None).run()

    if not status:
        sys.exit(-1)

    sys.exit(0)
예제 #2
0
def main(args):

    print("Simulator started\n")

    if 'HIVE_SIMULATOR' not in os.environ:
        print("Running in TEST-mode")
        return test()

    hivesim = os.environ['HIVE_SIMULATOR']
    print("Hive simulator: %s\n" % hivesim)
    hive = hivemodel.HiveAPI(hivesim)

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_FRONTIER))
    #        start=0, end=2)

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests/EIP150"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_TANGERINE))

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests/Homestead"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_HOMESTEAD))

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests/TestNetwork"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_TRANSITIONNET))

    status = hive.blockTests(testfiles=utils.getFilesRecursive(
        "./tests/BlockchainTests/GeneralStateTests/"),
                             executor=hivemodel.BlockTestExecutor(hive))
    #        whitelist=["mload32bitBound_return2_d0g0v0_EIP150"])

    if not status:
        sys.exit(-1)

    sys.exit(0)
예제 #3
0
파일: simulator.py 프로젝트: Smithgift/hive
def main(args):

    print("Simulator started\n")

    if 'HIVE_SIMULATOR' not in os.environ:
        print("Running in TEST-mode")
        return test()

    hivesim = os.environ['HIVE_SIMULATOR']
    print("Hive simulator: %s\n" % hivesim)
    hive = hivemodel.HiveAPI(hivesim)

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_FRONTIER))
    #        start=0, end=2, whitelist=["newChainFrom5Block"])

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests/EIP150"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_TANGERINE))

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests/Homestead"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_HOMESTEAD))

    status = hive.blockTests(
        testfiles=utils.getFiles("./tests/BlockchainTests/TestNetwork"),
        executor=hivemodel.BlockTestExecutor(hive, Rules.RULES_TRANSITIONNET),
        whitelist=["DaoTransactions_EmptyTransactionAndForkBlocksAhead"])

    status = hive.blockTests(testfiles=utils.getFilesRecursive(
        "./tests/BlockchainTests/GeneralStateTests/"),
                             executor=hivemodel.BlockTestExecutor(hive, None))

    if not status:
        sys.exit(-1)

    sys.exit(0)
예제 #4
0
파일: simulator.py 프로젝트: zilm13/hive
def main(args):

    print("Simulator started\n")

    if 'HIVE_SIMULATOR' not in os.environ:
        print("Running in TEST-mode")
        return test()

    hivesim = os.environ['HIVE_SIMULATOR']
    print("Hive simulator: %s\n" % hivesim)
    hive = hivemodel.HiveAPI(hivesim)

    status = hivemodel.BlockTestExecutor(
        hive_api=hive,
        testfiles=utils.getFilesRecursive("./tests/BlockchainTests/")).run()

    if not status:
        sys.exit(-1)

    sys.exit(0)
예제 #5
0
def test():
    hive = HiveTestAPI()
    executor = hivemodel.BlockTestExecutor(hive, Rules.RULES_TANGERINE)
    hive.blockTests(testfiles=utils.getFiles("./tests/BlockchainTests"),
                    executor=executor)
예제 #6
0
파일: simulator.py 프로젝트: zilm13/hive
def test():
    hive = HiveTestAPI()
    executor = hivemodel.BlockTestExecutor()
    hive.blockTests(testfiles=utils.getFiles("./tests/BlockchainTests"),
                    executor=executor)