Esempio n. 1
0
def test_contract_abi(web3, simple_test_contract: Contract):
    """Check that we can manipulate test contract from coinbase address."""

    # First check we can manipulate wallet from the coinbase address
    txid = simple_test_contract.transact().setValue(1)
    confirm_transaction(web3, txid)

    assert simple_test_contract.call().value() == 1
def test_call_contract(web3: Web3, hosted_wallet, simple_test_contract: Contract):
    """Call a test contract from the hosted wallet and see the value is correctly set."""

    magic = random.randint(0, 2**30)
    txid = hosted_wallet.execute(simple_test_contract, "setValue", args=[magic])
    confirm_transaction(web3, txid)

    assert simple_test_contract.call().value() == magic