Skip to content

Commit

Permalink
chore(communities)!: rename communitytokensv2 package to communitytokens
Browse files Browse the repository at this point in the history
This is a breaking change which renames `communitytokensv2` package to `communitytokens`.
  • Loading branch information
saledjenic committed Jan 23, 2025
1 parent 8be28cb commit 26ff226
Show file tree
Hide file tree
Showing 12 changed files with 25 additions and 22 deletions.
7 changes: 5 additions & 2 deletions api/geth_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,10 @@ func (b *GethStatusBackend) injectAccountsIntoWakuService(w wakutypes.WakuKeyMan
}

if st != nil {
if err := st.InitProtocol(b.statusNode.GethNode().Config().Name, identity, b.appDB, b.walletDB, b.statusNode.HTTPServer(), b.multiaccountsDB, acc, b.accountManager, b.statusNode.RPCClient(), b.statusNode.WalletService(), b.statusNode.CommunityTokensServiceV2(), b.statusNode.WakuV2Service(), logutils.ZapLogger(), b.statusNode.AccountsFeed()); err != nil {
if err := st.InitProtocol(b.statusNode.GethNode().Config().Name, identity, b.appDB, b.walletDB,
b.statusNode.HTTPServer(), b.multiaccountsDB, acc, b.accountManager, b.statusNode.RPCClient(),
b.statusNode.WalletService(), b.statusNode.CommunityTokensService(), b.statusNode.WakuV2Service(),
logutils.ZapLogger(), b.statusNode.AccountsFeed()); err != nil {
return err
}
// Set initial connection state
Expand All @@ -2709,7 +2712,7 @@ func (b *GethStatusBackend) injectAccountsIntoWakuService(w wakutypes.WakuKeyMan
}
b.statusNode.ChatService(accDB).Init(messenger)
b.statusNode.EnsService().Init(messenger.SyncEnsNamesWithDispatchMessage)
b.statusNode.CommunityTokensServiceV2().Init(messenger)
b.statusNode.CommunityTokensService().Init(messenger)
}

return nil
Expand Down
6 changes: 3 additions & 3 deletions node/get_status_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import (
appmetricsservice "github.com/status-im/status-go/services/appmetrics"
"github.com/status-im/status-go/services/browsers"
"github.com/status-im/status-go/services/chat"
"github.com/status-im/status-go/services/communitytokensv2"
"github.com/status-im/status-go/services/communitytokens"
"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 @@ -128,7 +128,7 @@ type StatusNode struct {
wakuV2Srvc *wakuv2.Waku
wakuV2ExtSrvc *wakuv2ext.Service
ensSrvc *ens.Service
communityTokensSrvcV2 *communitytokensv2.Service
communityTokensSrvc *communitytokens.Service
gifSrvc *gif.Service
stickersSrvc *stickers.Service
chatSrvc *chat.Service
Expand Down Expand Up @@ -518,7 +518,7 @@ func (n *StatusNode) stop() error {
n.wakuV2Srvc = nil
n.wakuV2ExtSrvc = nil
n.ensSrvc = nil
n.communityTokensSrvcV2 = nil
n.communityTokensSrvc = nil
n.stickersSrvc = nil
n.connectorSrvc = nil
n.publicMethods = make(map[string]bool)
Expand Down
12 changes: 6 additions & 6 deletions node/status_node_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (
appmetricsservice "github.com/status-im/status-go/services/appmetrics"
"github.com/status-im/status-go/services/browsers"
"github.com/status-im/status-go/services/chat"
"github.com/status-im/status-go/services/communitytokensv2"
"github.com/status-im/status-go/services/communitytokens"
"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 @@ -96,7 +96,7 @@ func (b *StatusNode) initServices(config *params.NodeConfig, mediaServer *server
services = append(services, b.statusPublicService())
services = append(services, b.pendingTrackerService(&b.walletFeed))
services = append(services, b.ensService(b.timeSourceNow()))
services = append(services, b.CommunityTokensServiceV2())
services = append(services, b.CommunityTokensService())
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 @@ -502,11 +502,11 @@ func (b *StatusNode) pendingTrackerService(walletFeed *event.Feed) *transactions
return b.pendingTracker
}

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

func (b *StatusNode) stickersService(accountDB *accounts.Database) *stickers.Service {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package communitytokensv2
package communitytokens

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package communitytokensv2
package communitytokens

import (
"testing"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package communitytokensv2
package communitytokens

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package communitytokensv2
package communitytokens

import (
"context"
Expand All @@ -24,7 +24,7 @@ import (
"github.com/status-im/status-go/protocol/communities/token"
"github.com/status-im/status-go/protocol/protobuf"
"github.com/status-im/status-go/rpc"
"github.com/status-im/status-go/services/communitytokensv2/communitytokensdatabase"
"github.com/status-im/status-go/services/communitytokens/communitytokensdatabase"
"github.com/status-im/status-go/services/wallet/bigint"
walletCommon "github.com/status-im/status-go/services/wallet/common"
"github.com/status-im/status-go/services/wallet/requests"
Expand Down Expand Up @@ -71,7 +71,7 @@ func (s *Service) Protocols() []p2p.Protocol {
func (s *Service) APIs() []ethRpc.API {
return []ethRpc.API{
{
Namespace: "communitytokensv2",
Namespace: "communitytokens",
Version: "0.1.0",
Service: NewAPI(s),
Public: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package communitytokensv2
package communitytokens

const currentVersion = "1.0.0"

Expand Down
6 changes: 3 additions & 3 deletions services/ext/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import (
"github.com/status-im/status-go/rpc"
"github.com/status-im/status-go/server"
"github.com/status-im/status-go/services/browsers"
"github.com/status-im/status-go/services/communitytokensv2"
"github.com/status-im/status-go/services/communitytokens"
"github.com/status-im/status-go/services/ext/mailservers"
mailserversDB "github.com/status-im/status-go/services/mailservers"
"github.com/status-im/status-go/services/wallet"
Expand Down Expand Up @@ -130,7 +130,7 @@ func (s *Service) GetPeer(rawURL string) (*enode.Node, error) {
func (s *Service) InitProtocol(nodeName string, identity *ecdsa.PrivateKey, appDb, walletDb *sql.DB,
httpServer *server.MediaServer, multiAccountDb *multiaccounts.Database, acc *multiaccounts.Account,
accountManager *account.GethManager, rpcClient *rpc.Client, walletService *wallet.Service,
communityTokensService *communitytokensv2.Service, wakuService *wakuv2.Waku, logger *zap.Logger,
communityTokensService *communitytokens.Service, wakuService *wakuv2.Waku, logger *zap.Logger,
accountsFeed *event.Feed) error {
var err error
if !s.config.ShhextConfig.PFSEnabled {
Expand Down Expand Up @@ -403,7 +403,7 @@ func buildMessengerOptions(
envelopesMonitorConfig *transport.EnvelopesMonitorConfig,
accountsDB *accounts.Database,
walletService *wallet.Service,
communityTokensService *communitytokensv2.Service,
communityTokensService *communitytokens.Service,
wakuService *wakuv2.Waku,
logger *zap.Logger,
messengerSignalsHandler protocol.MessengerSignalsHandler,
Expand Down
2 changes: 1 addition & 1 deletion services/wallet/token/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
"github.com/status-im/status-go/rpc/network"
"github.com/status-im/status-go/server"
"github.com/status-im/status-go/services/accounts/accountsevent"
"github.com/status-im/status-go/services/communitytokensv2/communitytokensdatabase"
"github.com/status-im/status-go/services/communitytokens/communitytokensdatabase"
"github.com/status-im/status-go/services/utils"
"github.com/status-im/status-go/services/wallet/bigint"
"github.com/status-im/status-go/services/wallet/community"
Expand Down

0 comments on commit 26ff226

Please sign in to comment.