Reduce logging noise

master
Hwee-Boon Yar 4 months ago
parent 41bc958845
commit c27e3c84f4
  1. 4
      modules/AlphaWalletFoundation/AlphaWalletFoundation/Tokens/Helpers/TokenInstanceActionAdapter.swift
  2. 10
      modules/AlphaWalletTokenScript/AlphaWalletTokenScript/Models/TokenInstanceAction.swift

@ -34,7 +34,7 @@ public struct TokenInstanceActionAdapter {
switch token.type {
case .erc1155, .erc721, .erc721ForTickets, .erc875:
let actionsFromTokenScript = xmlHandler.actions
infoLog("[TokenScript] actions names: \(actionsFromTokenScript.map(\.type))")
infoLog("[TokenScript] actions names: \(actionsFromTokenScript.map(\.debugName))")
let results: [TokenInstanceAction]
if xmlHandler.hasAssetDefinition {
results = actionsFromTokenScript
@ -59,7 +59,7 @@ public struct TokenInstanceActionAdapter {
}
case .erc20, .nativeCryptocurrency:
let actionsFromTokenScript = xmlHandler.actions
infoLog("[TokenScript] actions names: \(actionsFromTokenScript.map(\.type))")
infoLog("[TokenScript] actions names: \(actionsFromTokenScript.map(\.debugName))")
if actionsFromTokenScript.isEmpty {
switch token.type {
case .erc875, .erc721, .erc721ForTickets, .erc1155:

@ -100,6 +100,16 @@ public struct TokenInstanceAction {
public var hasTransactionFunction: Bool {
return transactionFunction != nil
}
public var debugName: String {
switch type {
case .erc20Send, .erc20Receive, .swap, .buy, .bridge, .nftRedeem, .nftSell, .nonFungibleTransfer, .openTokenScriptViewer:
return String(describing: self)
case .tokenScript(_, let title, _, _, _, _):
return "tokenScript: \(title)"
}
}
public let type: ActionType
public init(type: ActionType) {

Loading…
Cancel
Save