fix: properly initialize NFTMetadataProvider in wallet service

This commit is contained in:
Dario Gabriel Lipicar 2023-06-28 07:48:33 -03:00 committed by dlipicar
parent 5738cf7e21
commit ce45a7b1e8
2 changed files with 11 additions and 5 deletions

View File

@ -105,11 +105,6 @@ func (b *StatusNode) initServices(config *params.NodeConfig, mediaServer *server
services = append(services, wakuext)
}
if config.WalletConfig.Enabled {
walletService := b.walletService(accDB, accountsFeed)
services = append(services, walletService)
}
if config.WakuV2Config.Enabled {
telemetryServerURL := ""
if accDB.DB() != nil {
@ -135,6 +130,13 @@ func (b *StatusNode) initServices(config *params.NodeConfig, mediaServer *server
services = append(services, wakuext)
}
// Wallet Service makes use of wakuExtSrvc/wakuV2ExtSrvc
// Keep this initialization below the other two
if config.WalletConfig.Enabled {
walletService := b.walletService(accDB, accountsFeed)
services = append(services, walletService)
}
// We ignore for now local notifications flag as users who are upgrading have no mean to enable it
lns, err := b.localNotificationsService(config.NetworkID)
if err != nil {

View File

@ -2,6 +2,7 @@ package collectibles
import (
"context"
"fmt"
"strings"
"sync"
"time"
@ -254,6 +255,9 @@ func (o *Manager) processAssets(chainID uint64, assets []opensea.Asset) error {
}
if isMetadataEmpty(asset) {
if o.metadataProvider == nil {
return fmt.Errorf("NFTMetadataProvider not available")
}
tokenURI, err := o.fetchTokenURI(chainID, id)
if err != nil {