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