chores(@wallet): remove revert reason

It is never being used + couldn't get it from our node
This commit is contained in:
Anthony Laibe 2023-02-06 13:09:47 +01:00 committed by Anthony Laibe
parent 6e188de21a
commit bc353a1ccc
12 changed files with 25 additions and 42 deletions

View File

@ -58,7 +58,7 @@ proc init*(self: Controller) =
self.events.on(SIGNAL_ENS_TRANSACTION_REVERTED) do(e:Args):
let args = EnsTransactionArgs(e)
self.delegate.ensTransactionReverted(args.transactionType, args.ensUsername, args.transactionHash, args.revertReason)
self.delegate.ensTransactionReverted(args.transactionType, args.ensUsername, args.transactionHash)
self.events.on(SIGNAL_SHARED_KEYCARD_MODULE_USER_AUTHENTICATED) do(e: Args):
let args = SharedKeycarModuleArgs(e)

View File

@ -26,8 +26,7 @@ method ensTransactionConfirmed*(self: AccessInterface, trxType: string, ensUsern
{.base.} =
raise newException(ValueError, "No implementation available")
method ensTransactionReverted*(self: AccessInterface, trxType: string, ensUsername: string, transactionHash: string,
revertReason: string) {.base.} =
method ensTransactionReverted*(self: AccessInterface, trxType: string, ensUsername: string, transactionHash: string) {.base.} =
raise newException(ValueError, "No implementation available")
method viewDidLoad*(self: AccessInterface) {.base.} =

View File

@ -266,13 +266,12 @@ method ensTransactionConfirmed*(self: Module, trxType: string, ensUsername: stri
self.view.model().updatePendingStatus(chainId, ensUsername, false)
else:
self.view.model().addItem(Item(chainId: chainId, ensUsername: ensUsername, isPending: false))
self.view.emitTransactionCompletedSignal(true, transactionHash, ensUsername, trxType, "")
self.view.emitTransactionCompletedSignal(true, transactionHash, ensUsername, trxType)
method ensTransactionReverted*(self: Module, trxType: string, ensUsername: string, transactionHash: string,
revertReason: string) =
method ensTransactionReverted*(self: Module, trxType: string, ensUsername: string, transactionHash: string) =
let chainId = self.getChainIdForEns()
self.view.model().removeItemByEnsUsername(chainId, ensUsername)
self.view.emitTransactionCompletedSignal(false, transactionHash, ensUsername, trxType, revertReason)
self.view.emitTransactionCompletedSignal(false, transactionHash, ensUsername, trxType)
method getEnsRegisteredAddress*(self: Module): string =
return self.controller.getEnsRegisteredAddress()

View File

@ -95,11 +95,9 @@ QtObject:
proc emitUsernameConfirmedSignal*(self: View, ensUsername: string) =
self.usernameConfirmed(ensUsername)
proc transactionCompleted(self: View, success: bool, txHash: string, username: string, trxType: string,
revertReason: string) {.signal.}
proc emitTransactionCompletedSignal*(self: View, success: bool, txHash: string, username: string, trxType: string,
revertReason: string) =
self.transactionCompleted(success, txHash, username, trxType, revertReason)
proc transactionCompleted(self: View, success: bool, txHash: string, username: string, trxType: string) {.signal.}
proc emitTransactionCompletedSignal*(self: View, success: bool, txHash: string, username: string, trxType: string) =
self.transactionCompleted(success, txHash, username, trxType)
proc removeEnsUsername*(self: View, chainId: int, ensUsername: string): bool {.slot.} =
return self.delegate.removeEnsUsername(chainId, ensUsername)

View File

@ -99,7 +99,7 @@ proc init*(self: Controller) =
self.events.on(SIGNAL_STICKER_TRANSACTION_REVERTED) do(e:Args):
let args = StickerTransactionArgs(e)
self.delegate.stickerTransactionReverted(args.transactionType, args.packID, args.transactionHash, args.revertReason)
self.delegate.stickerTransactionReverted(args.transactionType, args.packID, args.transactionHash)
self.events.on(SIGNAL_SHARED_KEYCARD_MODULE_USER_AUTHENTICATED) do(e: Args):
let args = SharedKeycarModuleArgs(e)

View File

@ -98,8 +98,7 @@ method getChainIdForStickers*(self: AccessInterface): int {.base.} =
method stickerTransactionConfirmed*(self: AccessInterface, trxType: string, packID: string, transactionHash: string) {.base.} =
raise newException(ValueError, "No implementation available")
method stickerTransactionReverted*(self: AccessInterface, trxType: string, packID: string, transactionHash: string,
revertReason: string) {.base.} =
method stickerTransactionReverted*(self: AccessInterface, trxType: string, packID: string, transactionHash: string) {.base.} =
raise newException(ValueError, "No implementation available")
method onUserAuthenticated*(self: AccessInterface, password: string) {.base.} =

View File

@ -248,9 +248,8 @@ method getChainIdForStickers*(self: Module): int =
method stickerTransactionConfirmed*(self: Module, trxType: string, packID: string, transactionHash: string) =
self.view.stickerPacks.updateStickerPackInList(packID, true, false)
self.controller.installStickerPack(packID)
self.view.emitTransactionCompletedSignal(true, transactionHash, packID, trxType, "")
self.view.emitTransactionCompletedSignal(true, transactionHash, packID, trxType)
method stickerTransactionReverted*(self: Module, trxType: string, packID: string, transactionHash: string,
revertReason: string) =
method stickerTransactionReverted*(self: Module, trxType: string, packID: string, transactionHash: string) =
self.view.stickerPacks.updateStickerPackInList(packID, false, false)
self.view.emitTransactionCompletedSignal(false, transactionHash, packID, trxType, revertReason)
self.view.emitTransactionCompletedSignal(false, transactionHash, packID, trxType)

View File

@ -55,7 +55,7 @@ QtObject:
proc transactionWasSent*(self: View, txResult: string) {.signal.}
proc transactionCompleted*(self: View, success: bool, txHash: string, revertReason: string = "") {.signal.}
proc transactionCompleted*(self: View, success: bool, txHash: string) {.signal.}
proc estimate*(self: View, packId: string, address: string, price: string, uuid: string) {.slot.} =
self.delegate.estimate(packId, address, price, uuid)
@ -175,8 +175,6 @@ QtObject:
proc getStatusToken*(self: View): string {.slot.} =
return self.delegate.getStatusToken()
proc transactionCompleted(self: View, success: bool, txHash: string, packID: string, trxType: string,
revertReason: string) {.signal.}
proc emitTransactionCompletedSignal*(self: View, success: bool, txHash: string, packID: string, trxType: string,
revertReason: string) =
self.transactionCompleted(success, txHash, packID, trxType, revertReason)
proc transactionCompleted(self: View, success: bool, txHash: string, packID: string, trxType: string) {.signal.}
proc emitTransactionCompletedSignal*(self: View, success: bool, txHash: string, packID: string, trxType: string) =
self.transactionCompleted(success, txHash, packID, trxType)

View File

@ -60,7 +60,6 @@ type
transactionHash*: string
ensUsername*: string
transactionType*: string
revertReason*: string
# Signals which may be emitted by this service:
const SIGNAL_ENS_USERNAME_AVAILABILITY_CHECKED* = "ensUsernameAvailabilityChecked"
@ -111,10 +110,9 @@ QtObject:
self.pendingEnsUsernames.excl(dto)
self.events.emit(SIGNAL_ENS_TRANSACTION_CONFIRMED, data)
proc revertTransaction(self: Service, trxType: string, ensUsername: string, transactionHash: string,
revertReason: string) =
proc revertTransaction(self: Service, trxType: string, ensUsername: string, transactionHash: string) =
let dto = EnsUsernameDto(chainId: self.getChainId(), username: ensUsername)
let data = EnsTransactionArgs(transactionHash: transactionHash, ensUsername: ensUsername, transactionType: $trxType, revertReason: revertReason)
let data = EnsTransactionArgs(transactionHash: transactionHash, ensUsername: ensUsername, transactionType: $trxType)
self.pendingEnsUsernames.excl(dto)
self.events.emit(SIGNAL_ENS_TRANSACTION_REVERTED, data)
@ -124,16 +122,14 @@ QtObject:
if receivedData.success:
self.confirmTransaction($PendingTransactionTypeDto.RegisterENS, receivedData.data, receivedData.transactionHash)
else:
self.revertTransaction($PendingTransactionTypeDto.RegisterENS, receivedData.data, receivedData.transactionHash,
receivedData.revertReason)
self.revertTransaction($PendingTransactionTypeDto.RegisterENS, receivedData.data, receivedData.transactionHash)
self.events.on(PendingTransactionTypeDto.SetPubKey.event) do(e: Args):
var receivedData = TransactionMinedArgs(e)
if receivedData.success:
self.confirmTransaction($PendingTransactionTypeDto.SetPubKey, receivedData.data, receivedData.transactionHash)
else:
self.revertTransaction($PendingTransactionTypeDto.SetPubKey, receivedData.data, receivedData.transactionHash,
receivedData.revertReason)
self.revertTransaction($PendingTransactionTypeDto.SetPubKey, receivedData.data, receivedData.transactionHash)
proc init*(self: Service) =
self.doConnect()

View File

@ -49,7 +49,6 @@ type
transactionHash*: string
packID*: string
transactionType*: string
revertReason*: string
StickerPackInstalledArgs* = ref object of Args
packId*: string
@ -143,7 +142,7 @@ QtObject:
except:
error "Error confirming sticker transaction", message = getCurrentExceptionMsg()
proc revertTransaction(self: Service, trxType: string, packID: string, transactionHash: string, revertReason: string) =
proc revertTransaction(self: Service, trxType: string, packID: string, transactionHash: string) =
try:
if not self.marketStickerPacks.contains(packID):
let pendingStickerPacksResponse = status_stickers.pending()
@ -159,8 +158,7 @@ QtObject:
))
discard status_stickers.removePending(packID)
self.marketStickerPacks[packID].status = StickerPackStatus.Available
let data = StickerTransactionArgs(transactionHash: transactionHash, packID: packID, transactionType: $trxType,
revertReason: revertReason)
let data = StickerTransactionArgs(transactionHash: transactionHash, packID: packID, transactionType: $trxType)
self.events.emit(SIGNAL_STICKER_TRANSACTION_REVERTED, data)
except:
error "Error reverting sticker transaction", message = getCurrentExceptionMsg()
@ -175,8 +173,7 @@ QtObject:
if receivedData.success:
self.confirmTransaction($PendingTransactionTypeDto.BuyStickerPack, receivedData.data, receivedData.transactionHash)
else:
self.revertTransaction($PendingTransactionTypeDto.BuyStickerPack, receivedData.data, receivedData.transactionHash,
receivedData.revertReason)
self.revertTransaction($PendingTransactionTypeDto.BuyStickerPack, receivedData.data, receivedData.transactionHash)
proc buildTransaction*(
source: Address,

View File

@ -55,7 +55,6 @@ type
transactionHash*: string
chainId*: int
success*: bool
revertReason*: string
type
HistoryArgs* = ref object of Args
@ -153,7 +152,6 @@ QtObject:
transactionHash: hash,
chainId: chainId,
success: transactionReceipt{"status"}.getStr == "0x1",
revertReason: ""
)
self.events.emit(parseEnum[PendingTransactionTypeDto](watchTxResult["trxType"].getStr).event, ev)
transactions.checkRecentHistory(@[chainId], @[address])

View File

@ -326,7 +326,7 @@ Item {
Connections {
target: ensView.ensUsernamesStore.ensUsernamesModule
function onTransactionCompleted(success: bool, txHash: string, username: string, trxType: string, revertReason: string) {
function onTransactionCompleted(success: bool, txHash: string, username: string, trxType: string) {
let title = ""
switch(trxType){
case "RegisterENS":