Browse Source

Return address when creating contracts.

cl-refactor
Gav Wood 11 years ago
parent
commit
c5c3feed18
  1. 3
      libethereum/Client.cpp
  2. 3
      libethereum/Client.h

3
libethereum/Client.cpp

@ -156,7 +156,7 @@ void Client::transact(Secret _secret, u256 _value, Address _dest, bytes const& _
m_changed = true;
}
void Client::transact(Secret _secret, u256 _endowment, bytes const& _code, bytes const& _init, u256 _gas, u256 _gasPrice)
Address Client::transact(Secret _secret, u256 _endowment, bytes const& _code, bytes const& _init, u256 _gas, u256 _gasPrice)
{
lock_guard<recursive_mutex> l(m_lock);
Transaction t;
@ -171,6 +171,7 @@ void Client::transact(Secret _secret, u256 _endowment, bytes const& _code, bytes
cnote << "New transaction " << t;
m_tq.attemptImport(t.rlp());
m_changed = true;
return right160(sha3(rlpList(t.sender(), t.nonce)));
}
void Client::work()

3
libethereum/Client.h

@ -87,7 +87,8 @@ public:
void transact(Secret _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo);
/// Submits a new contract-creation transaction.
void transact(Secret _secret, u256 _endowment, bytes const& _code, bytes const& _init = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo);
/// @returns the new contract's address (assuming it all goes through).
Address transact(Secret _secret, u256 _endowment, bytes const& _code, bytes const& _init = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo);
/// Makes the given call. Nothing is recorded into the state. TODO
// bytes call(Secret _secret, u256 _amount, u256 _gasPrice, Address _dest, u256 _gas, bytes _data = bytes());

Loading…
Cancel
Save