refactor libstatus utils references

This commit is contained in:
Iuri Matias 2021-06-08 12:55:32 -04:00
parent 6e99b769be
commit 482aac8e98
31 changed files with 37 additions and 42 deletions

View File

@ -3,7 +3,7 @@ import ../../status/[status, mailservers]
import ../../status/libstatus/chat as libstatus_chat import ../../status/libstatus/chat as libstatus_chat
import ../../status/libstatus/accounts/constants import ../../status/libstatus/accounts/constants
import ../../status/libstatus/chat as core_chat import ../../status/libstatus/chat as core_chat
import ../../status/libstatus/utils as status_utils import ../../status/utils as status_utils
import ../../status/chat as status_chat import ../../status/chat as status_chat
import ../../status/messages as status_messages import ../../status/messages as status_messages
import ../../status/contacts as status_contacts import ../../status/contacts as status_contacts

View File

@ -1,7 +1,7 @@
import NimQml, Tables, std/wrapnils import NimQml, Tables, std/wrapnils
import ../../../status/[chat/chat, status, ens, accounts, settings] import ../../../status/[chat/chat, status, ens, accounts, settings]
from ../../../status/types import Setting from ../../../status/types import Setting
import ../../../status/libstatus/utils as status_utils import ../../../status/utils as status_utils
import chat_members import chat_members

View File

@ -1,7 +1,7 @@
import NimQml, tables, json, chronicles import NimQml, tables, json, chronicles
import ../../../status/[status, chat/message, chat/chat, settings] import ../../../status/[status, chat/message, chat/chat, settings]
import message_list, chat_item import message_list, chat_item
import ../../../status/libstatus/utils as status_utils import ../../../status/utils as status_utils
import ../../../status/types import ../../../status/types
logScope: logScope:

View File

@ -1,6 +1,6 @@
import NimQml, Tables, sequtils, sugar import NimQml, Tables, sequtils, sugar
import ../../../status/chat/stickers, ./sticker_list import ../../../status/chat/stickers, ./sticker_list
import ../../../status/types, ../../../status/libstatus/utils import ../../../status/types, ../../../status/utils
type type
StickerPackRoles {.pure.} = enum StickerPackRoles {.pure.} = enum

View File

@ -5,7 +5,7 @@ import # vendor libs
chronicles, NimQml chronicles, NimQml
import # status-desktop libs import # status-desktop libs
../../../status/[status, stickers, wallet, types], ../../../status/libstatus/utils, ../../../status/[status, stickers, wallet, types, utils],
../../../status/libstatus/stickers as status_stickers, sticker_pack_list, sticker_list, chat_item, ../../../status/tasks/[qt, task_runner_impl] ../../../status/libstatus/stickers as status_stickers, sticker_pack_list, sticker_list, chat_item, ../../../status/tasks/[qt, task_runner_impl]
logScope: logScope:

View File

@ -1,5 +1,5 @@
import NimQml, chronicles, sequtils, sugar, strutils, json import NimQml, chronicles, sequtils, sugar, strutils, json
import ../../../status/libstatus/utils as status_utils import ../../../status/utils as status_utils
import ../../../status/status import ../../../status/status
import ../../../status/chat/chat import ../../../status/chat/chat
import contact_list import contact_list

View File

@ -7,7 +7,7 @@ from ../../../status/types import Setting, PendingTransactionType, RpcException
import ../../../status/ens as status_ens import ../../../status/ens as status_ens
import ../../../status/libstatus/wallet as status_wallet import ../../../status/libstatus/wallet as status_wallet
import ../../../status/libstatus/settings as status_settings import ../../../status/libstatus/settings as status_settings
import ../../../status/libstatus/utils as libstatus_utils import ../../../status/utils as status_utils
import ../../../status/[status, settings, wallet] import ../../../status/[status, settings, wallet]
import ../../../status/wallet import ../../../status/wallet
import sets import sets
@ -204,7 +204,7 @@ QtObject:
proc getPrice(self: EnsManager): string {.slot.} = proc getPrice(self: EnsManager): string {.slot.} =
result = libstatus_utils.wei2Eth(getPrice()) result = status_utils.wei2Eth(getPrice())
proc getUsernameRegistrar(self: EnsManager): string {.slot.} = proc getUsernameRegistrar(self: EnsManager): string {.slot.} =
result = statusRegistrarAddress() result = statusRegistrarAddress()

View File

@ -6,7 +6,7 @@ import ../../status/libstatus/accounts/constants as accountConstants
import ../../status/libstatus/tokens import ../../status/libstatus/tokens
import ../../status/types import ../../status/types
import ../../status/libstatus/settings import ../../status/libstatus/settings
import ../../status/libstatus/utils as status_utils import ../../status/utils as status_utils
import ../../status/ens as status_ens import ../../status/ens as status_ens
import ../utils/image_utils import ../utils/image_utils
import web3/[ethtypes, conversions] import web3/[ethtypes, conversions]

View File

@ -11,7 +11,7 @@ import # status-desktop libs
../../status/libstatus/accounts/constants, ../../status/libstatus/accounts/constants,
../../status/libstatus/wallet as status_wallet, ../../status/libstatus/wallet as status_wallet,
../../status/libstatus/tokens, ../../status/types, ../../status/libstatus/tokens, ../../status/types,
../../status/libstatus/utils as status_utils, ../../status/utils as status_utils,
../../status/libstatus/eth/contracts, ../../status/ens as status_ens, ../../status/libstatus/eth/contracts, ../../status/ens as status_ens,
views/[asset_list, account_list, account_item, token_list, transaction_list, collectibles_list], views/[asset_list, account_list, account_item, token_list, transaction_list, collectibles_list],
../../status/tasks/[qt, task_runner_impl], ../../status/signals/types as signal_types ../../status/tasks/[qt, task_runner_impl], ../../status/signals/types as signal_types

View File

@ -5,7 +5,8 @@ import # vendor libs
NimQml NimQml
import # status-desktop libs import # status-desktop libs
../../../status/libstatus/[tokens, settings, utils, eth/contracts], ../../../status/[utils],
../../../status/libstatus/[tokens, settings, eth/contracts],
../../../status/tasks/[qt, task_runner_impl], ../../../status/status ../../../status/tasks/[qt, task_runner_impl], ../../../status/status
from web3/conversions import `$` from web3/conversions import `$`

View File

@ -3,7 +3,7 @@ import libstatus/accounts as status_accounts
import libstatus/settings as status_settings import libstatus/settings as status_settings
import libstatus/accounts/constants import libstatus/accounts/constants
import types import types
import libstatus/utils import utils
import ../eventemitter import ../eventemitter
type type

View File

@ -4,7 +4,7 @@ import libstatus/mailservers as status_mailservers
import libstatus/chatCommands as status_chat_commands import libstatus/chatCommands as status_chat_commands
import libstatus/accounts/constants as constants import libstatus/accounts/constants as constants
import types import types
import libstatus/utils as status_utils import utils as status_utils
import libstatus/contacts as status_contacts import libstatus/contacts as status_contacts
import stickers import stickers
import ../eventemitter import ../eventemitter

View File

@ -2,7 +2,7 @@ import json, sequtils, sugar, chronicles
import libstatus/contacts as status_contacts import libstatus/contacts as status_contacts
import libstatus/accounts as status_accounts import libstatus/accounts as status_accounts
import libstatus/chat as status_chat import libstatus/chat as status_chat
import libstatus/utils as status_utils import utils as status_utils
import chat/chat import chat/chat
#import chat/utils #import chat/utils
import profile/profile import profile/profile

View File

@ -7,7 +7,7 @@ import tables
import strformat import strformat
import libstatus/core import libstatus/core
import types import types
import libstatus/utils import utils
import libstatus/wallet import libstatus/wallet
import stew/byteutils import stew/byteutils
import unicode import unicode

View File

@ -2,7 +2,7 @@ import json, os, nimcrypto, uuids, json_serialization, chronicles, strutils
from status_go import multiAccountGenerateAndDeriveAddresses, generateAlias, identicon, saveAccountAndLogin, login, openAccounts from status_go import multiAccountGenerateAndDeriveAddresses, generateAlias, identicon, saveAccountAndLogin, login, openAccounts
import core import core
import utils as utils import ../utils as utils
import ../types as types import ../types as types
import accounts/constants import accounts/constants
import ../signals/types as signal_types import ../signals/types as signal_types

View File

@ -1,5 +1,5 @@
import json, times, strutils, sequtils, chronicles, json_serialization, algorithm, strformat, sugar import json, times, strutils, sequtils, chronicles, json_serialization, algorithm, strformat, sugar
import core, utils import core, ../utils
import ../chat/[chat, message] import ../chat/[chat, message]
import ../signals/messages import ../signals/messages
import ../types import ../types

View File

@ -1,5 +1,5 @@
import json, chronicles import json, chronicles
import core, utils import core, ../utils
proc acceptRequestAddressForTransaction*(messageId: string, address: string): string = proc acceptRequestAddressForTransaction*(messageId: string, address: string): string =
result = callPrivateRPC("acceptRequestAddressForTransaction".prefix, %* [messageId, address]) result = callPrivateRPC("acceptRequestAddressForTransaction".prefix, %* [messageId, address])

View File

@ -1,5 +1,5 @@
import json, strmisc, atomics import json, strmisc, atomics
import core, utils, ../types, settings import core, ../utils, ../types, settings
from ../profile/profile import Profile from ../profile/profile import Profile
var var

View File

@ -1,5 +1,5 @@
import json, nimcrypto, chronicles import json, nimcrypto, chronicles
import status_go, utils import status_go, ../utils
logScope: logScope:
topics = "rpc" topics = "rpc"

View File

@ -5,7 +5,7 @@ import
web3/ethtypes, stew/byteutils, nimcrypto, json_serialization, chronicles web3/ethtypes, stew/byteutils, nimcrypto, json_serialization, chronicles
import import
../../types, ../settings, ../coder, transactions, methods, ../utils ../../types, ../settings, ../coder, transactions, methods, ../../utils
export export
GetPackData, PackData, BuyToken, ApproveAndCall, Transfer, BalanceOf, Register, SetPubkey, GetPackData, PackData, BuyToken, ApproveAndCall, Transfer, BalanceOf, Register, SetPubkey,

View File

@ -1,4 +1,4 @@
import json, core, utils, system import json, core, ../utils, system
var installations: JsonNode = %*{} var installations: JsonNode = %*{}
var dirty: bool = true var dirty: bool = true

View File

@ -1,5 +1,5 @@
import json, times import json, times
import core, utils import core, ../utils
proc ping*(mailservers: seq[string], timeoutMs: int): string = proc ping*(mailservers: seq[string], timeoutMs: int): string =
var addresses: seq[string] = @[] var addresses: seq[string] = @[]

View File

@ -6,7 +6,7 @@ import
import import
./core, ../types, ../signals/types as statusgo_types, ./accounts/constants, ./core, ../types, ../signals/types as statusgo_types, ./accounts/constants,
./utils ../utils
var var
settings {.threadvar.}: JsonNode settings {.threadvar.}: JsonNode

View File

@ -7,7 +7,7 @@ import
import import
./settings, ./core, ./wallet, ./eth/contracts ./settings, ./core, ./wallet, ./eth/contracts
from ../types import Setting, Network, RpcResponse, RpcException from ../types import Setting, Network, RpcResponse, RpcException
from utils import parseAddress from ../utils import parseAddress
logScope: logScope:
topics = "wallet" topics = "wallet"

View File

@ -1,6 +1,5 @@
import json, json, options, json_serialization, stint, chronicles import json, json, options, json_serialization, stint, chronicles
import core, ../types, utils, strutils, strformat import core, ../types, ../utils, strutils, strformat
import utils
from status_go import validateMnemonic#, startWallet from status_go import validateMnemonic#, startWallet
import ../wallet/account import ../wallet/account
import web3/ethtypes import web3/ethtypes

View File

@ -1,6 +1,6 @@
import json, random, strutils, sequtils, sugar, chronicles, tables import json, random, strutils, sequtils, sugar, chronicles, tables
import json_serialization import json_serialization
import ../libstatus/utils import ../utils
import ../libstatus/accounts as status_accounts import ../libstatus/accounts as status_accounts
import ../libstatus/accounts/constants as constants import ../libstatus/accounts/constants as constants
import ../libstatus/settings as status_settings import ../libstatus/settings as status_settings
@ -11,7 +11,7 @@ import ../chat/[chat, message]
import ../profile/[profile, devices] import ../profile/[profile, devices]
import types import types
import web3/conversions import web3/conversions
from ../libstatus/utils import parseAddress, wei2Eth from ../utils import parseAddress, wei2Eth
proc toMessage*(jsonMsg: JsonNode, pk: string): Message proc toMessage*(jsonMsg: JsonNode, pk: string): Message

View File

@ -8,7 +8,7 @@ import # local deps
types, libstatus/eth/contracts as status_contracts, types, libstatus/eth/contracts as status_contracts,
libstatus/stickers as status_stickers, transactions, libstatus/stickers as status_stickers, transactions,
libstatus/wallet, ../eventemitter libstatus/wallet, ../eventemitter
from libstatus/utils as libstatus_utils import eth2Wei, gwei2Wei, toUInt64, parseAddress from utils as libstatus_utils import eth2Wei, gwei2Wei, toUInt64, parseAddress
logScope: logScope:

View File

@ -6,7 +6,7 @@ import
import import
types types
from libstatus/utils as status_utils import toUInt64, gwei2Wei, parseAddress from utils as status_utils import toUInt64, gwei2Wei, parseAddress
proc buildTransaction*(source: Address, value: Uint256, gas = "", gasPrice = "", data = ""): EthSend = proc buildTransaction*(source: Address, value: Uint256, gas = "", gasPrice = "", data = ""): EthSend =
result = EthSend( result = EthSend(

View File

@ -1,14 +1,9 @@
import # std libs import json, random, strutils, strformat, tables, chronicles, unicode
json, random, strutils, strformat, tables, times, unicode import stint
from sugar import `=>`, `->` from times import getTime, toUnix, nanosecond
import libstatus/accounts/signing_phrases
import # vendor libs
stint, chronicles
from web3 import Address, fromHex from web3 import Address, fromHex
import # status-desktop libs
accounts/signing_phrases
proc getTimelineChatId*(pubKey: string = ""): string = proc getTimelineChatId*(pubKey: string = ""): string =
if pubKey == "": if pubKey == "":
return "@timeline70bd746ddcc12beb96b2c9d572d0784ab137ffc774f5383e50585a932080b57cca0484b259e61cecbaa33a4c98a300a" return "@timeline70bd746ddcc12beb96b2c9d572d0784ab137ffc774f5383e50585a932080b57cca0484b259e61cecbaa33a4c98a300a"

View File

@ -11,7 +11,7 @@ import libstatus/accounts/constants as constants
import libstatus/eth/[eth, contracts] import libstatus/eth/[eth, contracts]
from libstatus/core import getBlockByNumber from libstatus/core import getBlockByNumber
from types import PendingTransactionType, GeneratedAccount, DerivedAccount, Transaction, Setting, GasPricePrediction, `%`, StatusGoException, Network, RpcResponse, RpcException from types import PendingTransactionType, GeneratedAccount, DerivedAccount, Transaction, Setting, GasPricePrediction, `%`, StatusGoException, Network, RpcResponse, RpcException
from libstatus/utils as libstatus_utils import eth2Wei, gwei2Wei, first, toUInt64, parseAddress from utils as libstatus_utils import eth2Wei, gwei2Wei, first, toUInt64, parseAddress
import wallet/[balance_manager, account, collectibles] import wallet/[balance_manager, account, collectibles]
import transactions import transactions
import ../eventemitter import ../eventemitter

View File

@ -8,7 +8,7 @@ import # vendor libs
import # status-desktop libs import # status-desktop libs
../libstatus/core as status, ../libstatus/eth/contracts as contracts, ../libstatus/core as status, ../libstatus/eth/contracts as contracts,
../libstatus/stickers as status_stickers, ../types, ../libstatus/stickers as status_stickers, ../types,
web3/[conversions, ethtypes], ../libstatus/utils, account web3/[conversions, ethtypes], ../utils, account
const CRYPTOKITTY* = "cryptokitty" const CRYPTOKITTY* = "cryptokitty"
const KUDO* = "kudo" const KUDO* = "kudo"