Skip to content

Commit 3640463

Browse files
authored
chore: remove unused transaction request methods (#18955)
1 parent b20f944 commit 3640463

File tree

7 files changed

+0
-160
lines changed

7 files changed

+0
-160
lines changed

src/app/modules/main/chat_section/chat_content/input_area/controller.nim

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -159,24 +159,6 @@ proc sendChatMessage*(self: Controller,
159159
paymentRequests
160160
)
161161

162-
proc requestAddressForTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
163-
self.chatService.requestAddressForTransaction(self.chatId, fromAddress, amount, tokenAddress)
164-
165-
proc requestTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
166-
self.chatService.requestTransaction(self.chatId, fromAddress, amount, tokenAddress)
167-
168-
proc declineRequestTransaction*(self: Controller, messageId: string) =
169-
self.chatService.declineRequestTransaction(messageId)
170-
171-
proc declineRequestAddressForTransaction*(self: Controller, messageId: string) =
172-
self.chatService.declineRequestAddressForTransaction(messageId)
173-
174-
proc acceptRequestAddressForTransaction*(self: Controller, messageId: string, address: string) =
175-
self.chatService.acceptRequestAddressForTransaction(messageId, address)
176-
177-
proc acceptRequestTransaction*(self: Controller, transactionHash: string, messageId: string, signature: string) =
178-
self.chatService.acceptRequestTransaction(transactionHash, messageId, signature)
179-
180162
proc getLinkPreviewEnabled*(self: Controller): bool =
181163
return self.linkPreviewPersistentSetting == UrlUnfurlingMode.Enabled or self.linkPreviewCurrentMessageSetting == UrlUnfurlingMode.Enabled
182164

src/app/modules/main/chat_section/chat_content/input_area/io_interface.nim

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,6 @@ method sendChatMessage*(self: AccessInterface, msg: string, replyTo: string, con
2626
method sendImages*(self: AccessInterface, imagePathsJson: string, msg: string, replyTo: string, linkPreviews: seq[LinkPreview], paymentRequests: seq[PaymentRequest]) {.base.} =
2727
raise newException(ValueError, "No implementation available")
2828

29-
method requestAddressForTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
30-
raise newException(ValueError, "No implementation available")
31-
32-
method requestTransaction*(self: AccessInterface, fromAddress: string, amount: string, tokenAddress: string) {.base.} =
33-
raise newException(ValueError, "No implementation available")
34-
35-
method declineRequestTransaction*(self: AccessInterface, messageId: string) {.base.} =
36-
raise newException(ValueError, "No implementation available")
37-
38-
method declineRequestAddressForTransaction*(self: AccessInterface, messageId: string) {.base.} =
39-
raise newException(ValueError, "No implementation available")
40-
41-
method acceptRequestAddressForTransaction*(self: AccessInterface, messageId: string, address: string) {.base.} =
42-
raise newException(ValueError, "No implementation available")
43-
44-
method acceptRequestTransaction*(self: AccessInterface, transactionHash: string, messageId: string, signature: string) {.base.} =
45-
raise newException(ValueError, "No implementation available")
46-
4729
method searchGifs*(self: AccessInterface, query: string) {.base.} =
4830
raise newException(ValueError, "No implementation available")
4931

src/app/modules/main/chat_section/chat_content/input_area/module.nim

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,6 @@ method sendChatMessage*(
7979
self.controller.sendChatMessage(msg, replyTo, contentType,
8080
singletonInstance.userProfile.getPreferredName(), linkPreviews, paymentRequests)
8181

82-
method requestAddressForTransaction*(self: Module, fromAddress: string, amount: string, tokenAddress: string) =
83-
self.controller.requestAddressForTransaction(fromAddress, amount, tokenAddress)
84-
85-
method requestTransaction*(self: Module, fromAddress: string, amount: string, tokenAddress: string) =
86-
self.controller.requestTransaction(fromAddress, amount, tokenAddress)
87-
88-
method declineRequestTransaction*(self: Module, messageId: string) =
89-
self.controller.declineRequestTransaction(messageId)
90-
91-
method declineRequestAddressForTransaction*(self: Module, messageId: string) =
92-
self.controller.declineRequestAddressForTransaction(messageId)
93-
94-
method acceptRequestAddressForTransaction*(self: Module, messageId: string, address: string) =
95-
self.controller.acceptRequestAddressForTransaction(messageId, address)
96-
97-
method acceptRequestTransaction*(self: Module, transactionHash: string, messageId: string, signature: string) =
98-
self.controller.acceptRequestTransaction(transactionHash, messageId, signature)
99-
10082
method setText*(self: Module, text: string, unfurlNewUrls: bool) =
10183
self.controller.setText(text, unfurlNewUrls)
10284

src/app/modules/main/chat_section/chat_content/input_area/view.nim

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,6 @@ QtObject:
6363
self.delegate.setText(msg, false)
6464
self.delegate.sendImages(imagePathsJson, msg, replyTo, self.linkPreviewModel.getUnfuledLinkPreviews(), self.payment_request_model.getPaymentRequests())
6565

66-
proc acceptAddressRequest*(self: View, messageId: string , address: string) {.slot.} =
67-
self.delegate.acceptRequestAddressForTransaction(messageId, address)
68-
69-
proc declineAddressRequest*(self: View, messageId: string) {.slot.} =
70-
self.delegate.declineRequestAddressForTransaction(messageId)
71-
72-
proc requestAddress*(self: View, fromAddress: string, amount: string, tokenAddress: string) {.slot.} =
73-
self.delegate.requestAddressForTransaction(fromAddress, amount, tokenAddress)
74-
75-
proc request*(self: View, fromAddress: string, amount: string, tokenAddress: string) {.slot.} =
76-
self.delegate.requestTransaction(fromAddress, amount, tokenAddress)
77-
78-
proc declineRequest*(self: View, messageId: string) {.slot.} =
79-
self.delegate.declineRequestTransaction(messageId)
80-
81-
proc acceptRequestTransaction*(self: View, transactionHash: string, messageId: string, signature: string) {.slot.} =
82-
self.delegate.acceptRequestTransaction(transactionHash, messageId, signature)
83-
8466
proc getPreservedProperties(self: View): QVariant {.slot.} =
8567
return self.preservedPropertiesVariant
8668

src/app_service/service/chat/service.nim

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,12 @@ import ../contacts/service as contact_service
1212
import backend/chat as status_chat
1313
import backend/communities as status_communities
1414
import backend/group_chat as status_group_chat
15-
import backend/chatCommands as status_chat_commands
1615
import app/global/[global_singleton, utils]
1716
import app/core/eventemitter
1817
import app/core/signals/types
1918
import constants
2019

2120
import ../../common/message as message_common
22-
from ../../common/account_constants import ZERO_ADDRESS
2321

2422
export chat_dto
2523

@@ -326,11 +324,6 @@ QtObject:
326324
self.updateOrAddChat(chat)
327325
self.signalChatsAndMessagesUpdates(@[chat], messages)
328326

329-
proc processUpdateForTransaction*(self: Service, messageId: string, response: RpcResponse[JsonNode]) =
330-
var (chats, _) = self.processMessengerResponse(response)
331-
# TODO: Signal is not handled anywhere
332-
self.events.emit(SIGNAL_MESSAGE_REMOVE, MessageArgs(id: messageId, channel: chats[0].id))
333-
334327
proc parseChatResponseAndEmit*(self: Service, response: RpcResponse[JsonNode]) =
335328
var (chats, _) = self.parseChatResponse(response)
336329
self.events.emit(SIGNAL_CHAT_UPDATE, ChatUpdateArgs(chats: chats))
@@ -521,50 +514,6 @@ QtObject:
521514
error "Error sending message", msg = e.msg
522515
self.events.emit(SIGNAL_SENDING_FAILED, MessageSendingFailure(chatId: rpcResponseObj["chatId"].getStr, error: e.msg))
523516

524-
proc requestAddressForTransaction*(self: Service, chatId: string, fromAddress: string, amount: string, tokenAddress: string) =
525-
try:
526-
let address = if (tokenAddress == ZERO_ADDRESS): "" else: tokenAddress
527-
let response = status_chat_commands.requestAddressForTransaction(chatId, fromAddress, amount, address)
528-
discard self.processMessengerResponse(response)
529-
except Exception as e:
530-
error "Error requesting address for transaction", msg = e.msg
531-
532-
proc requestTransaction*(self: Service, chatId: string, fromAddress: string, amount: string, tokenAddress: string) =
533-
try:
534-
let address = if (tokenAddress == ZERO_ADDRESS): "" else: tokenAddress
535-
let response = status_chat_commands.requestTransaction(chatId, fromAddress, amount, address)
536-
discard self.processMessengerResponse(response)
537-
except Exception as e:
538-
error "Error requesting transaction", msg = e.msg
539-
540-
proc declineRequestTransaction*(self: Service, messageId: string) =
541-
try:
542-
let response = status_chat_commands.declineRequestTransaction(messageId)
543-
self.processUpdateForTransaction(messageId, response)
544-
except Exception as e:
545-
error "Error requesting transaction", msg = e.msg
546-
547-
proc declineRequestAddressForTransaction*(self: Service, messageId: string) =
548-
try:
549-
let response = status_chat_commands.declineRequestAddressForTransaction(messageId)
550-
self.processUpdateForTransaction(messageId, response)
551-
except Exception as e:
552-
error "Error requesting transaction", msg = e.msg
553-
554-
proc acceptRequestAddressForTransaction*(self: Service, messageId: string, address: string) =
555-
try:
556-
let response = status_chat_commands.acceptRequestAddressForTransaction(messageId, address)
557-
self.processUpdateForTransaction(messageId, response)
558-
except Exception as e:
559-
error "Error requesting transaction", msg = e.msg
560-
561-
proc acceptRequestTransaction*(self: Service, transactionHash: string, messageId: string, signature: string) =
562-
try:
563-
let response = status_chat_commands.acceptRequestTransaction(transactionHash, messageId, signature)
564-
discard self.processMessengerResponse(response)
565-
except Exception as e:
566-
error "Error requesting transaction", msg = e.msg
567-
568517
proc muteChat*(self: Service, chatId: string, interval: int) =
569518
try:
570519
if(chatId.len == 0):

src/backend/chatCommands.nim

Lines changed: 0 additions & 21 deletions
This file was deleted.

ui/app/AppLayouts/Chat/stores/RootStore.qml

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -530,22 +530,6 @@ QtObject {
530530
return profileSectionModule.ensUsernamesModule.getFiatValue(balance, cryptoSymbol, fiatSymbol)
531531
}
532532

533-
function acceptRequestTransaction(transactionHash, messageId, signature) {
534-
return currentChatContentModule().inputAreaModule.acceptRequestTransaction(transactionHash, messageId, signature)
535-
}
536-
537-
function acceptAddressRequest(messageId, address) {
538-
currentChatContentModule().inputAreaModule.acceptAddressRequest(messageId, address)
539-
}
540-
541-
function declineAddressRequest(messageId) {
542-
currentChatContentModule().inputAreaModule.declineAddressRequest(messageId)
543-
}
544-
545-
function declineRequest(messageId) {
546-
currentChatContentModule().inputAreaModule.declineRequest(messageId)
547-
}
548-
549533
function resolveENS(value) {
550534
mainModuleInst.resolveENS(value, "")
551535
}

0 commit comments

Comments
 (0)