Merge pull request #3659 from oa-s/#3654

pull/3663/head
Hwee-Boon Yar 3 years ago committed by GitHub
commit d32896d2be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      AlphaWallet/Core/Coordinators/WalletBalance/PrivateBalanceFetcher.swift

@ -134,7 +134,6 @@ class PrivateBalanceFetcher: PrivateBalanceFetcherType {
private func refreshBalanceForNonErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> { private func refreshBalanceForNonErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> {
assert(!tokens.contains { $0.isERC721Or1155AndNotForTickets }) assert(!tokens.contains { $0.isERC721Or1155AndNotForTickets })
guard !tokens.isEmpty else { return .value([]) }
let promises = tokens.map { getBalanceForNonErc721Or1155Tokens(forToken: $0) } let promises = tokens.map { getBalanceForNonErc721Or1155Tokens(forToken: $0) }
return when(resolved: promises).map { values -> [PrivateBalanceFetcher.TokenBatchOperation] in return when(resolved: promises).map { values -> [PrivateBalanceFetcher.TokenBatchOperation] in
return values.compactMap { $0.optionalValue }.compactMap { $0 } return values.compactMap { $0.optionalValue }.compactMap { $0 }
@ -250,7 +249,6 @@ class PrivateBalanceFetcher: PrivateBalanceFetcherType {
private func refreshBalanceForErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> { private func refreshBalanceForErc721Or1155Tokens(tokens: [Activity.AssignedToken]) -> Promise<[PrivateBalanceFetcher.TokenBatchOperation]> {
assert(!tokens.contains { !$0.isERC721Or1155AndNotForTickets }) assert(!tokens.contains { !$0.isERC721Or1155AndNotForTickets })
guard !tokens.isEmpty else { return .value([]) }
let tokensFromOpenSeaPromise = getTokensFromOpenSea() let tokensFromOpenSeaPromise = getTokensFromOpenSea()
let enjinTokensPromise = getTokensFromEnjin() let enjinTokensPromise = getTokensFromEnjin()

Loading…
Cancel
Save