chore: refactor ensRegisterAddress too and update the ui to use utilsModel

This commit is contained in:
hydr063n 2020-09-28 15:47:15 +02:00 committed by Iuri Matias
parent 25748ce682
commit 968923e8be
4 changed files with 10 additions and 9 deletions

View File

@ -200,12 +200,6 @@ QtObject:
self.endResetModel()
self.transactionCompleted(false, transactionHash, ensUsername, $trxType, revertReason)
proc getEnsRegisterAddress(self: EnsManager): QVariant {.slot.} =
newQVariant($statusRegistrarAddress())
QtProperty[QVariant] ensRegisterAddress:
read = getEnsRegisterAddress
proc registerENSGasEstimate(self: EnsManager, ensUsername: string, address: string): int {.slot.} =
var success: bool
let pubKey = status_settings.getSetting[string](Setting.PublicKey, "0x0")

View File

@ -5,6 +5,7 @@ import ../../status/libstatus/accounts/constants as accountConstants
import ../../status/libstatus/tokens
import ../../status/libstatus/wallet as status_wallet
import ../../status/libstatus/utils as status_utils
import ../../status/ens as status_ens
QtObject:
type UtilsView* = ref object of QObject
@ -49,3 +50,9 @@ QtObject:
QtProperty[QVariant] stickerMarketAddress:
read = getStickerMarketAddress
proc getEnsRegisterAddress(self: UtilsView): QVariant {.slot.} =
newQVariant($statusRegistrarAddress())
QtProperty[QVariant] ensRegisterAddress:
read = getEnsRegisterAddress

View File

@ -87,7 +87,7 @@ ModalPopup {
visible: false
accounts: walletModel.accounts
contacts: profileModel.addedContacts
selectedRecipient: { "address": profileModel.ens.ensRegisterAddress, "type": RecipientSelector.Type.Address }
selectedRecipient: { "address": utilsModel.ensRegisterAddress, "type": RecipientSelector.Type.Address }
readOnly: true
onSelectedRecipientChanged: gasSelector.estimateGas()
}

View File

@ -92,7 +92,7 @@ ModalPopup {
visible: false
accounts: walletModel.accounts
contacts: profileModel.addedContacts
selectedRecipient: { "address": profileModel.ens.ensRegisterAddress, "type": RecipientSelector.Type.Address }
selectedRecipient: { "address": utilsModel.ensRegisterAddress, "type": RecipientSelector.Type.Address }
readOnly: true
onSelectedRecipientChanged: gasSelector.estimateGas()
}