def execute(self, *args, **kwargs):
     return {
         'raw-address': web3.eth.coinbase,
         'raw-txn': '0xebb0f76aa6a6bb8d178ac2354de83d73a728d704bf47d135c188ca7b6d25f2e4',
         'no-key': Address.defer(value=web3.eth.coinbase),
         'with-key': String.defer(key='this-is-a-key', value='this-is-a-string'),
     }
 def execute(self, *args, **kwargs):
     return {
         'raw-address':
         web3.eth.coinbase,
         'raw-txn':
         '0xebb0f76aa6a6bb8d178ac2354de83d73a728d704bf47d135c188ca7b6d25f2e4',
         'no-key':
         Address.defer(value=web3.eth.coinbase),
         'with-key':
         String.defer(key='this-is-a-key', value='this-is-a-string'),
     }
Exemple #3
0
def test_deployment_linking_with_provided_registrar_value(
        deploy_chain, library_13, verify_multiply_13_linked):
    chain = deploy_chain
    web3 = chain.web3
    registrar = chain.registrar

    set_library_addr_txn_hash = registrar.transact().setAddress(
        'a-custom-key',
        library_13.address,
    )
    chain.wait.for_receipt(set_library_addr_txn_hash, timeout=30)

    deploy_operation = DeployContract(
        'Multiply13',
        timeout=30,
        libraries={
            'Library13': Address.defer(key='a-custom-key'),
        },
    )

    verify_multiply_13_linked(deploy_operation)
def test_deployment_linking_with_provided_registrar_value(deploy_chain,
                                                          library_13,
                                                          verify_multiply_13_linked):
    chain = deploy_chain
    web3 = chain.web3
    registrar = chain.registrar

    set_library_addr_txn_hash = registrar.transact().setAddress(
        'a-custom-key',
        library_13.address,
    )
    chain.wait.for_receipt(set_library_addr_txn_hash, timeout=30)

    deploy_operation = DeployContract(
        'Multiply13',
        timeout=30,
        libraries={
            'Library13': Address.defer(key='a-custom-key'),
        },
    )

    verify_multiply_13_linked(deploy_operation)
Exemple #5
0
    (
        (
            Operation(),
            {'populus.migrations.operations'},
            "populus.migrations.operations.Operation()\n",
        ),
        (
            SendTransaction({}),
            {'populus.migrations.operations'},
            """populus.migrations.operations.SendTransaction(
    transaction={},
)\n""",
        ),
        (
            SendTransaction({
                'to': Address.defer(key='contracts/Math'),
            },
                            timeout=1234),
            {'populus.migrations.operations', 'populus.migrations.deferred'},
            """populus.migrations.operations.SendTransaction(
    timeout=1234,
    transaction={
        'to': populus.migrations.deferred.Address.defer(
            key='contracts/Math',
        ),
    },
)\n""",
        ),
        (
            TransactContract(
                contract_name='Math',
    (
        (
            Operation(),
            {'populus.migrations.operations'},
            "populus.migrations.operations.Operation()\n",
        ),
        (
            SendTransaction({}),
            {'populus.migrations.operations'},
            """populus.migrations.operations.SendTransaction(
    transaction={},
)\n""",
        ),
        (
            SendTransaction({
                'to': Address.defer(key='contracts/Math'),
            }, timeout=1234),
            {'populus.migrations.operations', 'populus.migrations.deferred'},
            """populus.migrations.operations.SendTransaction(
    timeout=1234,
    transaction={
        'to': populus.migrations.deferred.Address.defer(
            key='contracts/Math',
        ),
    },
)\n""",
        ),
        (
            TransactContract(
                contract_name='Math',
                method_name='increment',