Browse Source

Fixes.

cl-refactor
Gav Wood 11 years ago
parent
commit
8a5fdc3cd2
  1. 3
      alethzero/MainWin.cpp
  2. 4
      libethereum/Instruction.cpp
  3. 2
      libethereum/State.h

3
alethzero/MainWin.cpp

@ -526,9 +526,10 @@ void Main::on_data_textChanged()
if (isCreation())
{
string code = ui->data->toPlainText().toStdString();
m_init.clear();
m_data = compileLisp(code, true, m_init);
ui->code->setPlainText(QString::fromStdString(disassemble(m_data)) + "\n; Init:" + QString::fromStdString(disassemble(m_init)));
ui->gas->setMinimum((qint64)state().createGas(m_data.size() + m_init.size()));
ui->gas->setMinimum((qint64)state().createGas(m_data.size() + m_init.size(), 0));
ui->gas->setEnabled(true);
}
else

4
libethereum/Instruction.cpp

@ -321,7 +321,7 @@ static unsigned pushLiteral(bytes& o_code, u256 _literalValue)
for (unsigned i = 0; i < br; ++i)
{
o_code[o_code.size() - 1 - i] = (byte)(_literalValue & 0xff);
_literalValue <<= 8;
_literalValue >>= 8;
}
return br + 1;
}
@ -883,7 +883,7 @@ string eth::disassemble(bytes const& _mem)
{
if (numerics)
numerics--;
ret << "0x" << hex << n << " ";
ret << "0x" << hex << (int)n << " ";
}
else
{

2
libethereum/State.h

@ -177,7 +177,7 @@ public:
u256 playback(bytesConstRef _block, BlockInfo const& _bi, BlockInfo const& _parent, BlockInfo const& _grandParent, bool _fullCommit);
/// Get the fee associated for a contract created with the given data.
u256 createGas(uint _nonZeroStorageCount) const { return c_sstoreGas * _nonZeroStorageCount + c_createGas; }
u256 createGas(uint _dataCount, u256 _gas = 0) const { return c_txDataGas * _dataCount + c_createGas + _gas; }
/// Get the fee associated for a normal transaction.
u256 callGas(uint _dataCount, u256 _gas = 0) const { return c_txDataGas * _dataCount + c_callGas + _gas; }

Loading…
Cancel
Save