Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove copypaste in test_contract_db[Insert|Update|UpdateExt] #62

Open
potehinre opened this issue May 20, 2018 · 0 comments
Open

remove copypaste in test_contract_db[Insert|Update|UpdateExt] #62

potehinre opened this issue May 20, 2018 · 0 comments

Comments

@potehinre
Copy link
Contributor

        columns = """[{"name":"name","type":"varchar",
        "index": "1",  "conditions":"true"},
        {"name":"test","type":"varchar",
        "index": "0",  "conditions":"true"}]"""
        permission = """{"insert": "true",
        "update" : "true","new_column": "true"}"""
        data = {"Name": "test", "ApplicationId":1,
                "Columns": columns,
                "Permissions": permission}
        result = utils.call_contract(url, prKey, "NewTable", data, token)
        tx = utils.txstatus(url,
                                self.config["1"]["time_wait_tx_in_block"],
                                result['hash'], token)
        contract = self.contracts["dbInsert"]
        self.check_contract(contract["code"], contract["asert"])

why not move that piece of code to helper functions, it copypasted tree times, in all test_contact_db..
https://github.com/GenesisKernel/genesis-tests/blob/6f57ca7ef9dc460cf469ac3643267cc076480d3f/contract_functions_tests.py#L192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant