Browse Source

- bug fix: #1399

cl-refactor
yann300 10 years ago
parent
commit
5b18f853b7
  1. 11
      mix/MixClient.cpp
  2. 2
      mix/MixClient.h
  3. 6
      mix/qml/html/WebContainer.html

11
mix/MixClient.cpp

@ -89,6 +89,7 @@ void MixClient::resetState(std::map<Secret, u256> _accounts)
SecureTrieDB<Address, MemoryDB> accountState(&m_stateDB);
accountState.init();
m_userAccounts.clear();
std::map<Address, Account> genesisState;
for (auto account: _accounts)
{
@ -243,15 +244,15 @@ ExecutionResult MixClient::execution(unsigned _index) const
return m_executions.at(_index);
}
State MixClient::asOf(int _block) const
State MixClient::asOf(BlockNumber _h) const
{
ReadGuard l(x_state);
if (_block == 0)
return m_state;
else if (_block == -1)
if (_h == PendingBlock)
return m_startState;
else if (_h == LatestBlock)
return m_state;
else
return State(m_stateDB, bc(), bc().numberHash(_block));
return State(m_stateDB, bc(), bc().numberHash(_h));
}
void MixClient::submitTransaction(Secret _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice)

2
mix/MixClient.h

@ -100,7 +100,7 @@ public:
private:
void executeTransaction(dev::eth::Transaction const& _t, eth::State& _state, bool _call);
void noteChanged(h256Set const& _filters);
dev::eth::State asOf(int _block) const;
dev::eth::State asOf(eth::BlockNumber _block) const;
MixBlockChain& bc() { return *m_bc; }
MixBlockChain const& bc() const { return *m_bc; }

6
mix/qml/html/WebContainer.html

@ -23,9 +23,9 @@ updateContracts = function(contracts) {
var contractProto = window.web3.eth.contract(contracts[c].interface);
var contract = new contractProto(contracts[c].address);
window.contracts[c] = {
address: c.address,
interface: c.interface,
contract: contract,
address: contracts[c].address,
interface: contracts[c].interface,
contract: contract
};
}
}

Loading…
Cancel
Save