Browse Source

Merge pull request #1930 from arkpar/mix_fix

Mix: Fixed gas calculation
cl-refactor
Arkadiy Paronyan 10 years ago
parent
commit
ff3360079b
  1. 4
      mix/MixClient.cpp
  2. 8
      mix/qml/DeploymentDialog.qml

4
mix/MixClient.cpp

@ -220,7 +220,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c
d.address = _t.receiveAddress();
d.sender = _t.sender();
d.value = _t.value();
d.gasUsed = er.gasUsed + er.gasRefunded;
d.gasUsed = er.gasUsed + er.gasRefunded + c_callStipend;
if (_t.isCreation())
d.contractAddress = right160(sha3(rlpList(_t.sender(), _t.nonce())));
if (!_call)
@ -234,7 +234,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c
er =_state.execute(lastHashes, t);
if (t.isCreation() && _state.code(d.contractAddress).empty())
BOOST_THROW_EXCEPTION(OutOfGas() << errinfo_comment("Not enough gas for contract deployment"));
d.gasUsed = er.gasUsed + er.gasRefunded + er.gasForDeposit;
d.gasUsed = er.gasUsed + er.gasRefunded + er.gasForDeposit + c_callStipend;
// collect watches
h256Set changed;
Guard l(x_filtersWatches);

8
mix/qml/DeploymentDialog.qml

@ -15,7 +15,7 @@ Dialog {
id: modalDeploymentDialog
modality: Qt.ApplicationModal
width: 735
height: 400
height: 450
visible: false
property int ownedRegistrarDeployGas: 1179075 // TODO: Use sol library to calculate gas requirement for each tr.
property int ownedRegistrarSetSubRegistrarGas: 50000
@ -293,15 +293,15 @@ Dialog {
DefaultLabel
{
text: qsTr("Root Registrar address:")
visible: false //still use it for now in dev env.
visible: true //still use it for now in dev env.
}
DefaultTextField
{
Layout.preferredWidth: 350
id: registrarAddr
text: "ab69f864e49fc4294d18355c4bafb0b91b5e629b"
visible: false
text: "c6d9d2cd449a754c494264e1809c50e34d64562b"
visible: true
}
DefaultLabel

Loading…
Cancel
Save