Hot answers tagged

3

Where is the problem? In the broader stack trace, you'll see that _encode_abi is actually in web3.py, so it's more of a web3 issue than a populus one. This has been a long-standing issue in web3.py v3, and v4-beta works as expected; you can pass in a hex string to an ABI bytes* argument. See https://github.com/ethereum/web3.py/issues/329 where this issue ...


3

The error you have is not related to Populus: Dynamic exception type: boost::exception_detail::clone_impl<dev::solidity::InternalCompilerError> E std::exception::what: std::exception It says Solidity cannot compile your contract because of a bug. Please repeat the issue by manually compiling the contracts from the command line and then issuing ...


2

After installing some other tools (like EthereumJS testrpc) the problem was solved by itself. I guess it was solc compiler which wasn't installed properly on my computer. Used to build solidity compiler from source but then installed it as a npm package, which was much easier. So, if you have the same problem. Try checking if solc command works.


2

For versions of populus pre 1.5.0 the short answer is that you cant. This is due to an upstream bug in the gevent-http-client dependency in how it handles SSL certificates. For versions >=1.5.0 you'd put this in your config file. Note that the new configuration file format is JSON. Populus will try to upgrade your old configuration file for you ...


2

Instead of passing bytes value as string, we have to pass the argument as hex-data, by removing 0x at the beginning.. test.py: def test_greeter(web3, accounts, chain): hex_string = "adc4f61a8a9995668f01ef1e2a0977be34c1d74d925a9a33d7f0b8fb4972a1ce"; hexData = hex_string.decode("hex"); set_txn_hash = myContract.transact().set(hexData); //now ...


2

The current best way to do this is to include a contract with the parameters hard coded like the following. contract HasParameters { function A(uint value) { } } contract HardCodedParameters is HasParameters(12345) { function HardCodedParameters() {} } This will allow you to run populus deploy HardCodedParameters and have the contract deployed ...


2

Having number of transactions in a block is possible but doing it manually is not possible, Block is created in 2 situations, 1.Time out period is reached. There is a time out period to create a block (the exact time out period is unknown to me, may be 1 or 2 seconds), the transaction made in-between this timeout period are kept under a single block. ...


1

What web3.eth.getTransactionReceipt returns is a Python dictionary. You can access Python dictonary items using the square bracket syntax: receipt = web3.eth.getTransactionReceipt("0x1139cca78666519a834cf40670faa4f01324a04f0ec4e6072863bf4812598a5f") gasUsed = receipt["gasUsed"] print(gasUsed) For further information please see this Python tutorial.


1

Just adding the answer from the above comments, so that this question can be closed: sudo pip install --upgrade populus should solve this problem. Although no one is likely to have this specific issue anymore.


1

Have you tried the docs here @ http://viper.readthedocs.io/en/latest/installing-vyper.html? They might be updated. Took me a while but got it going after a good effort. Let me know if not and I'll try to help!


1

This code returns -1 for me (for both int8 and int): pragma solidity ^0.4.6; contract NumTest { int8 i; function NumTest() { i = -1; } function number() constant returns (int8 num) { return i; } } As has been mentioned in previous threads, due to unpacking costs, the int8 case (278 gas) is actually more expensive ...


1

I have tested @Rob Hitchens BlockHash contract. The reason I was getting "0x" was a @Tjaden Hess mentioned: "the reason for "0x" is I can only get the block hashes for the last 256 blocks within a contract." In the following example since blockchain starts from block number 0, I can retrieve block hash for block number 1. Python integration side, ...


1

Here's something that works as expected using javascript/truffle. BlockHash.sol contract BlockHash { function isBlockHash(uint blockNumber, bytes32 checkHash) public constant returns(bool isIndeed) { return(block.blockhash(blockNumber) == checkHash); } function getBlockHash(uint blockNumber) ...


1

Can you try without your infura token? i.e. simply: rpc_host = https://ropsten.infura.io


1

From the documentation for populus init: Running $ populus init will initialize the current directory with the default project layout that populus uses. ./contracts/ ./contracts/Example.sol ./tests/test_examply.py ./html/index.html ./assets/ Note that it initialises the current directory - i.e. from where you're running the command, ...


1

The error is saying that you do not have a directory: /home/petr/Projects/populus-tests/contracts Is that the case? If yes create it and copy your contract source files into it.


Only top voted, non community-wiki answers of a minimum length are eligible