Example #1
0
    def __init__(self, args):
        self.running_scenarios = []
        self.ran_scenarios = []
        self.args = args
        self.tests_ok = True
        self.dao_addr = None
        self.offer_addr = None
        self.token_amounts = None
        self.prop_id = None
        self.tests_dir = os.path.dirname(os.path.realpath(__file__))
        datadir = os.path.join(self.tests_dir, "data")
        self.save_file = os.path.join(datadir, "saved")
        self.templates_dir = os.path.join(self.tests_dir, 'templates')
        self.contracts_dir = os.path.dirname(self.tests_dir)
        self.solc = determine_binary(args.solc, 'solc')
        self.geth = determine_binary(args.geth, 'geth')

        if args.describe_scenarios:
            self.describe_scenarios()
            sys.exit(0)

        # keep this at end since any data loaded should override constructor
        if not os.path.isdir(datadir) or args.clean_chain:
            self.clean_blockchain()
            self.create_accounts(args.users_num)
        else:
            self.attemptLoad()
Example #2
0
    def __init__(self, args):
        self.running_scenarios = []
        self.ran_scenarios = []
        self.args = args
        self.tests_ok = True
        self.dao_address = None
        self.offer_address = None
        self.token_amounts = None
        self.dao_sources = [
            "DAO.sol",
            "DAOTokenCreationProxyTransferer.sol",
            "ManagedAccount.sol",
            "Token.sol",
            "TokenCreation.sol"
        ]
        self.tests_dir = os.path.dirname(os.path.realpath(__file__))
        datadir = os.path.join(self.tests_dir, "data")
        self.save_file = os.path.join(datadir, "saved")
        self.templates_dir = os.path.join(self.tests_dir, 'templates')
        self.contracts_dir = os.path.dirname(self.tests_dir)
        self.solc = determine_binary(args.solc, 'solc', args.scenario != 'none')
        self.geth = determine_binary(args.geth, 'geth', args.scenario != 'none')

        if args.describe_scenarios:
            self.describe_scenarios()
            sys.exit(0)

        # keep this at end since any data loaded should override constructor
        if not os.path.isdir(datadir) or args.clean_chain:
            self.clean_blockchain()
            self.init_data(args.users_num)
        else:
            self.attemptLoad()
Example #3
0
    def __init__(self, args):
        self.running_scenarios = []
        self.ran_scenarios = []
        self.args = args
        self.tests_ok = True
        self.foundation_addr = None
        self.contract1_addr = None
        self.token_amounts = None
        self.tests_dir = os.path.dirname(os.path.realpath(__file__))
        datadir = os.path.join(self.tests_dir, "data")
        self.save_file = os.path.join(datadir, "saved")
        self.templates_dir = os.path.join(self.tests_dir, 'templates')
        self.contracts_dir = os.path.dirname(self.tests_dir)
        self.solc = determine_binary(args.solc, 'solc')
        self.geth = determine_binary(args.geth, 'geth')

        if args.describe_scenarios:
            self.describe_scenarios()
            sys.exit(0)

        # keep this at end since any data loaded should override constructor
        if not os.path.isdir(datadir) or args.clean_chain:
            self.clean_blockchain()
            self.init_data(args.users_num)
        else:
            self.attemptLoad()
Example #4
0
    def __init__(self, args):
        self.args = args
        self.tests_ok = True
        self.dao_addr = None  # check to determine if DAO is deployed
        self.offer_addr = None  # check to determine if offer is deployed
        self.token_amounts = None  # check to determine if funding happened
        self.prop_id = None  # check to if we have ran proposal scenario
        self.tests_dir = os.path.dirname(os.path.realpath(__file__))
        self.save_file = os.path.join(self.tests_dir, "data", "saved")
        self.templates_dir = os.path.join(self.tests_dir, 'templates')
        self.contracts_dir = os.path.dirname(self.tests_dir)
        self.solc = determine_binary(args.solc, 'solc')
        self.geth = determine_binary(args.geth, 'geth')

        self.min_value = args.min_value
        self.test_scenarios = {
            'none': self.run_test_none,
            'deploy': self.run_test_deploy,
            'fund': self.run_test_fund,
            'proposal': self.run_test_proposal,
            'rewards': self.run_test_rewards,
            'split': self.run_test_split,
            'split-insufficient-gas': self.run_test_split_insufficient_gas,
        }

        # keep this at end since any data loaded should override constructor
        if args.clean_chain:
            self.clean_blockchain()
            self.create_accounts(args.users_num)
        else:
            self.attemptLoad()
Example #5
0
    def __init__(self, args):
        self.running_scenarios = []
        self.args = args
        self.tests_ok = True
        self.dao_addr = None  # check to determine if DAO is deployed
        self.offer_addr = None  # check to determine if offer is deployed
        self.token_amounts = None  # check to determine if funding happened
        self.prop_id = None  # check to if we have ran proposal scenario
        self.tests_dir = os.path.dirname(os.path.realpath(__file__))
        self.save_file = os.path.join(self.tests_dir, "data", "saved")
        self.templates_dir = os.path.join(self.tests_dir, 'templates')
        self.contracts_dir = os.path.dirname(self.tests_dir)
        self.solc = determine_binary(args.solc, 'solc')
        self.geth = determine_binary(args.geth, 'geth')

        # keep this at end since any data loaded should override constructor
        if args.clean_chain:
            self.clean_blockchain()
            self.create_accounts(args.users_num)
        else:
            self.attemptLoad()