Skip to content

Commit

Permalink
chore(community)_: duplicated community tokens package
Browse files Browse the repository at this point in the history
  • Loading branch information
saledjenic committed Dec 18, 2024
1 parent 990c8b6 commit 5ae936f
Show file tree
Hide file tree
Showing 12 changed files with 2,309 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/geth_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -2709,6 +2709,7 @@ func (b *GethStatusBackend) injectAccountsIntoWakuService(w types.WakuKeyManager
b.statusNode.ChatService(accDB).Init(messenger)
b.statusNode.EnsService().Init(messenger.SyncEnsNamesWithDispatchMessage)
b.statusNode.CommunityTokensService().Init(messenger)
b.statusNode.CommunityTokensServiceV2().Init(messenger)
}

return nil
Expand Down
2 changes: 2 additions & 0 deletions node/get_status_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import (
"github.com/status-im/status-go/services/browsers"
"github.com/status-im/status-go/services/chat"
"github.com/status-im/status-go/services/communitytokens"
"github.com/status-im/status-go/services/communitytokensv2"
"github.com/status-im/status-go/services/connector"
"github.com/status-im/status-go/services/ens"
"github.com/status-im/status-go/services/eth"
Expand Down Expand Up @@ -129,6 +130,7 @@ type StatusNode struct {
wakuV2ExtSrvc *wakuv2ext.Service
ensSrvc *ens.Service
communityTokensSrvc *communitytokens.Service
communityTokensSrvcV2 *communitytokensv2.Service
gifSrvc *gif.Service
stickersSrvc *stickers.Service
chatSrvc *chat.Service
Expand Down
9 changes: 9 additions & 0 deletions node/status_node_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/status-im/status-go/services/browsers"
"github.com/status-im/status-go/services/chat"
"github.com/status-im/status-go/services/communitytokens"
"github.com/status-im/status-go/services/communitytokensv2"
"github.com/status-im/status-go/services/connector"
"github.com/status-im/status-go/services/ens"
"github.com/status-im/status-go/services/eth"
Expand Down Expand Up @@ -97,6 +98,7 @@ func (b *StatusNode) initServices(config *params.NodeConfig, mediaServer *server
services = append(services, b.pendingTrackerService(&b.walletFeed))
services = append(services, b.ensService(b.timeSourceNow()))
services = append(services, b.CommunityTokensService())
services = append(services, b.CommunityTokensServiceV2())
services = append(services, b.stickersService(accDB))
services = append(services, b.updatesService())
services = appendIf(b.appDB != nil && b.multiaccountsDB != nil, services, b.accountsService(&b.accountsFeed, accDB, mediaServer))
Expand Down Expand Up @@ -509,6 +511,13 @@ func (b *StatusNode) CommunityTokensService() *communitytokens.Service {
return b.communityTokensSrvc
}

func (b *StatusNode) CommunityTokensServiceV2() *communitytokensv2.Service {
if b.communityTokensSrvcV2 == nil {
b.communityTokensSrvcV2 = communitytokensv2.NewService(b.rpcClient, b.gethAccountManager, b.pendingTracker, b.config, b.appDB, &b.walletFeed, b.transactor)
}
return b.communityTokensSrvcV2
}

func (b *StatusNode) stickersService(accountDB *accounts.Database) *stickers.Service {
if b.stickersSrvc == nil {
b.stickersSrvc = stickers.NewService(accountDB, b.rpcClient, b.gethAccountManager, b.config, b.downloader, b.httpServer, b.pendingTracker)
Expand Down
Loading

0 comments on commit 5ae936f

Please sign in to comment.