Open 4gn3s opened 8 years ago
After some more testing, I was able to confirm that the code did not get deployed at all. I haven't, however, received any error about this. This is some more logs about the transaction:
In [1]: code ="""
...: ....: contract NameReg {
...: ....: event AddressRegistered(bytes32 indexed name, address indexed account);
...: ....: mapping (address => bytes32) toName;
...: ....:
...: ....: function register(bytes32 name) {
...: ....: toName[msg.sender] = name;
...: ....: AddressRegistered(name, msg.sender);
...: ....: }
...: ....:
...: ....: function resolve(address addr) constant returns (bytes32 name) {
...: ....: return toName[addr];
...: ....: }
...: ....: }
...: ....: """
In [2]: evm_code = solidity.compile(code)
In [3]: abi = solidity.mk_full_signature(code)
In [4]: tx = eth.transact(to='', data=evm_code, startgas=500000)
In [5]: tx.sender
Out[5]: '\x8e\xd6m\r\xd4\xb8\x8f\xb0\x97\xa3\xa3\xc8\xc1\x01u\xb8\xca\xdb\x1cf'
In [6]: eth.coinbase
Out[6]: '\x8e\xd6m\r\xd4\xb8\x8f\xb0\x97\xa3\xa3\xc8\xc1\x01u\xb8\xca\xdb\x1cf'
In [7]: eth.find_transaction(tx)
Out[7]: {'block': <Block(#30 3476785d)>, 'index': 0, 'tx': <Transaction(026c)>}
In [8]: eth.latest.get_code(tx.creates)
Out[8]: ''
In [9]: tx
Out[9]: <Transaction(026c)>
In [10]: tx.to_dict()
Out[10]:
{'data': '```@R`\xab\x80`\x10`\x009`\x00\xf3```@R`\xe0`\x02\n`\x005\x04cU\xealG\x81\x14`$W\x80c\xe1\xfa\x8e\x84\x14`TW[\x00[s\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff`\x045\x16`\x00\x90\x81R` \x81\x81R`@\x90\x91 T``\x90\x81R\xf3[`"`\x045s\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff3\x16`\x00\x81\x81R` \x81\x90R`@\x81 \x83\x90U\x82\x90\x7f,\xdav:\x9dz\xe9$\x1f"\xe2!\x94\x7fe\xe3\x1e|\xf5\x8dy\xff\x18\xe3\xba\xddr\xac\xf4\xbe\x14\x89\x90``\xa3PV',
'gasprice': 60000000000,
'hash': '026c7a1e6551c81b390d6418034c389ed70f4f33e529d8c0c6f12c8cbc29d68a',
'nonce': 1048595,
'r': 27658781706602874032610195404402144102381924050538974420397862279255605044700L,
's': 46254478970772610353317232515709069812327479835241987339329102033936505301870L,
'sender': '\x8e\xd6m\r\xd4\xb8\x8f\xb0\x97\xa3\xa3\xc8\xc1\x01u\xb8\xca\xdb\x1cf',
'startgas': 500000,
'to': '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00',
'v': 28,
'value': 0}
In [11]: tx.creates
Out[11]: '\xf5\xa1W]\xfd\x8d\x98\x1a\xb3U\x1b]\x1aI\xdd\x1bO\x85\x991'
Hi. I am following the tutorial from here in Hydrachain to create a sample contract and interact with it. I run three separate Hydrachain nodes using the 'rundummy' syntax. The transactions are created and added to blocks successfully. However, when registering a new name in contract, a new event is thrown, which should be visible in logs, and they are empty. Later, when trying to resolve the name, I also get an empty string. Is there any reason why this would not work in Hydrachain?
This is my console output:
The more detailed logs are here:
I have also written a simple test with tester, doing basically the same thing:
and the test passes, so I guess this is not a problem with my solidity compiler (I'm using
Version: 0.3.2-0/RelWithDebInfo-Linux/g++/Interpreter
).