fix: deploy contracts in browser
This commit is contained in:
parent
87a34104c2
commit
cc9830268a
|
@ -114,7 +114,7 @@ QtObject:
|
|||
try:
|
||||
let request = data.request.parseJson
|
||||
let fromAddress = request["params"][0]["from"].getStr()
|
||||
let to = request["params"][0]["to"].getStr()
|
||||
let to = request["params"][0]{"to"}.getStr()
|
||||
let value = if (request["params"][0]["value"] != nil):
|
||||
request["params"][0]["value"].getStr()
|
||||
else:
|
||||
|
|
|
@ -16,6 +16,8 @@ proc estimateGas*(tx: EthSend): RpcResponse =
|
|||
trace "Gas estimated succesfully", estimate=result.result
|
||||
|
||||
proc sendTransaction*(tx: EthSend, password: string): RpcResponse =
|
||||
if not tx.hasKey("to"):
|
||||
tx["to"] = ""
|
||||
let responseStr = core.sendTransaction($(%tx), password)
|
||||
result = Json.decode(responseStr, RpcResponse)
|
||||
if not result.error.isNil:
|
||||
|
|
|
@ -126,6 +126,8 @@ proc sendTransaction*(self: WalletModel, source, to, value, gas, gasPrice, passw
|
|||
parseAddress(source),
|
||||
eth2Wei(parseFloat(value), 18), gas, gasPrice, data
|
||||
)
|
||||
|
||||
if to != "":
|
||||
tx.to = parseAddress(to).some
|
||||
|
||||
result = eth.sendTransaction(tx, password, success)
|
||||
|
|
|
@ -22,7 +22,7 @@ Column {
|
|||
|
||||
function validate() {
|
||||
let isValid = true
|
||||
if (!(account && account.assets && asset && amount > 0)) {
|
||||
if (!(account && account.assets && asset && amount >= 0)) {
|
||||
return root.isValid
|
||||
}
|
||||
const currAcctAsset = Utils.findAssetBySymbol(account.assets, asset.symbol)
|
||||
|
|
|
@ -81,9 +81,11 @@ Item {
|
|||
switch (root.selectedType) {
|
||||
case RecipientSelector.Type.Address:
|
||||
inpAddress.text = selectedRecipient.name || ""
|
||||
inpAddress.selectedAddress = selectedRecipient.address
|
||||
inpAddress.visible = true
|
||||
selContact.visible = selAccount.visible = false
|
||||
if(!!selectedRecipient.address){
|
||||
inpAddress.selectedAddress = selectedRecipient.address
|
||||
}
|
||||
break
|
||||
case RecipientSelector.Type.Contact:
|
||||
selContact.selectedContact = selectedRecipient
|
||||
|
|
|
@ -123,7 +123,7 @@ Item {
|
|||
when: !!root.toAccount && root.toAccount.type === RecipientSelector.Type.Address
|
||||
PropertyChanges {
|
||||
target: txtToPrimary
|
||||
text: !!root.toAccount ? root.toAccount.address : ""
|
||||
text: (!!root.toAccount && root.toAccount.address) ? root.toAccount.address : qsTr("Unknown")
|
||||
elide: Text.ElideMiddle
|
||||
anchors.leftMargin: 190
|
||||
anchors.right: parent.right
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 49cfa2f3135139c3488b68fdd061cc069d31d651
|
Loading…
Reference in New Issue