23 static const QString PRC_COMMAND =
"callcontract";
24 static const QString PARAM_ADDRESS =
"address";
25 static const QString PARAM_DATAHEX =
"datahex";
26 static const QString PARAM_SENDER =
"sender";
37 m_ABIFunctionField(0),
66 QStringList lstMandatory;
67 lstMandatory.append(PARAM_ADDRESS);
68 lstMandatory.append(PARAM_DATAHEX);
69 QStringList lstOptional;
70 lstOptional.append(PARAM_SENDER);
71 QMap<QString, QString> lstTranslations;
89 QRegularExpression regEx;
92 addressValidatr->setRegularExpression(regEx);
133 bool dataValid =
true;
166 QMap<QString, QString> lstParams;
168 QString errorMessage;
178 if(errorMessage.isEmpty() &&
m_execRPCCommand->
exec(lstParams, result, resultJson, errorMessage))
191 QMessageBox::warning(
this, tr(
"Call contract"), errorMessage);
207 bool enabled = func != -1;
311 std::vector<ParameterABI::ErrorType> errors;
313 if(
function.
abiIn(values, strData, errors))
315 return QString::fromStdString(strData);
319 errorMessage =
function.errorMessage(errors,
true);
QLabel * labelContractAddress
QToolButton * pasteAddressButton
#define SetObjectStyleSheet(object, name)
const QString & getAddressValue() const
int lookupAddress(const QString &address) const
void on_loadInfoClicked()
Dialog for editing a contract information.
const PlatformStyle * m_platformStyle
void setupUi(QWidget *CallContract)
QToolButton * loadInfoButton
void setABI(const QString &ABI)
void setModel(WalletModel *model)
CallContract(const PlatformStyle *platformStyle, QWidget *parent=0)
QValidatedLineEdit * lineEditContractAddress
void on_pasteAddressClicked()
void setResultData(QVariant result, FunctionABI function, QList< QStringList > paramValues, ContractTxType type)
ContractTableModel * getContractTableModel()
QLabel * labelSenderAddress
QPushButton * pushButtonClearAll
ExecRPCCommand * m_execRPCCommand
ClientModel * m_clientModel
void setIsValidManually(bool value)
std::vector< FunctionABI > functions
void on_refresh()
on_refresh Refresh the list of addresses
std::vector< std::vector< std::string > > getValuesVector()
getValuesVector Get params values vector List of all parameters that can be sent to a function...
QScrollArea * scrollAreaFunction
void on_updateCallContractButton()
QString getAddress() const
bool exec(const QMap< QString, QString > ¶ms, QVariant &result, QString &resultJson, QString &errorMessage)
exec Execute the RPC command
bool addTab(int index, const QString &name)
addTab Add new tab
QString abiForAddress(const QString &address) const
bytes abiIn(std::string _id, T const &..._t)
void setContractABI(ContractABI *contractABI)
setContractABI Set the contract ABI (list of functions from the contract)
void setCurrent(int index)
setCurrent Set current index
ContractTableModel * m_contractModel
QStackedWidget * stackedWidget
void on_callContractClicked()
bool isValidInterfaceABI()
AddressField * lineEditSenderAddress
void setClientModel(ClientModel *clientModel)
int getSelectedFunction() const
getSelectedFunction Get the ABI for the selected function from the contract
void on_saveInfoClicked()
void setModel(ContractTableModel *model)
QToolButton * saveInfoButton
void clear()
clear Remove all tabs except the first one which is not closable
Model for Fabcoin network client.
void setModel(ContractTableModel *model)
The ABIFunctionField class ABI functions widget.
void on_numBlocksChanged()
The ExecRPCCommand class Execution of RPC command line.
QList< QStringList > getParamsValues()
getParamsValues Get the values of the whole list of input parameters for the selected function ...
QPushButton * pushButtonCallContract
Interface to Fabcoin wallet from Qt view code.
virtual QString currentText() const
currentText Get the current text
void setComboBoxEditable(bool editable)
void setCheckValidator(const QValidator *v)
The TabBarInfo class Class for informations about tabs.
static void appendParam(QMap< QString, QString > ¶ms, const QString ¶mName, const QString ¶mValue)
appendParam Append paramether to the list
QValidatedTextEdit * textEditInterface
bool loads(const std::string &json_data)
void on_contractAddressChanged()
void on_clearAllClicked()
struct evm_uint160be address(struct evm_env *env)
void formatToolButtons(QToolButton *btn1, QToolButton *btn2, QToolButton *btn3)
bool isValidContractAddress()
ABIFunctionField * m_ABIFunctionField
void setAddress(const QString &address)
void setContractAddress(const QString &address)
QString toDataHex(int func, QString &errorMessage)
ContractABI * m_contractABI