Skip to content

Commit

Permalink
chore(communities)!: remove communitytokens package
Browse files Browse the repository at this point in the history
This is a breaking change which removes `communitytokens` package.

This commit removes old `communitytokens` package, cause previously added `communitytokensv2` package,
which is in use now, will be renamed to `communitytokens` in next commit.
  • Loading branch information
saledjenic committed Jan 29, 2025
1 parent e506a13 commit 98e6579
Show file tree
Hide file tree
Showing 17 changed files with 11 additions and 2,324 deletions.
3 changes: 1 addition & 2 deletions api/geth_backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -2692,7 +2692,7 @@ 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.CommunityTokensService(), 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.CommunityTokensServiceV2(), b.statusNode.WakuV2Service(), logutils.ZapLogger(), b.statusNode.AccountsFeed()); err != nil {
return err
}
// Set initial connection state
Expand All @@ -2709,7 +2709,6 @@ func (b *GethStatusBackend) injectAccountsIntoWakuService(w wakutypes.WakuKeyMan
}
b.statusNode.ChatService(accDB).Init(messenger)
b.statusNode.EnsService().Init(messenger.SyncEnsNamesWithDispatchMessage)
b.statusNode.CommunityTokensService().Init(messenger)
b.statusNode.CommunityTokensServiceV2().Init(messenger)
}

Expand Down
4 changes: 1 addition & 3 deletions node/get_status_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ 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/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"
Expand Down Expand Up @@ -129,7 +128,6 @@ type StatusNode struct {
wakuV2Srvc *wakuv2.Waku
wakuV2ExtSrvc *wakuv2ext.Service
ensSrvc *ens.Service
communityTokensSrvc *communitytokens.Service
communityTokensSrvcV2 *communitytokensv2.Service
gifSrvc *gif.Service
stickersSrvc *stickers.Service
Expand Down Expand Up @@ -520,7 +518,7 @@ func (n *StatusNode) stop() error {
n.wakuV2Srvc = nil
n.wakuV2ExtSrvc = nil
n.ensSrvc = nil
n.communityTokensSrvc = nil
n.communityTokensSrvcV2 = nil
n.stickersSrvc = nil
n.connectorSrvc = nil
n.publicMethods = make(map[string]bool)
Expand Down
9 changes: 0 additions & 9 deletions node/status_node_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ 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/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"
Expand Down Expand Up @@ -97,7 +96,6 @@ 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.CommunityTokensService())
services = append(services, b.CommunityTokensServiceV2())
services = append(services, b.stickersService(accDB))
services = append(services, b.updatesService())
Expand Down Expand Up @@ -504,13 +502,6 @@ func (b *StatusNode) pendingTrackerService(walletFeed *event.Feed) *transactions
return b.pendingTracker
}

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

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)
Expand Down
2 changes: 0 additions & 2 deletions protocol/communities/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import (
walletcommon "github.com/status-im/status-go/services/wallet/common"
"github.com/status-im/status-go/services/wallet/thirdparty"
"github.com/status-im/status-go/services/wallet/token"
"github.com/status-im/status-go/services/wallet/wallettypes"
"github.com/status-im/status-go/signal"

wakutypes "github.com/status-im/status-go/waku/types"
Expand Down Expand Up @@ -270,7 +269,6 @@ type AssetContractData struct {

type CommunityTokensServiceInterface interface {
GetCollectibleContractData(chainID uint64, contractAddress string) (*CollectibleContractData, error)
SetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string, txArgs wallettypes.SendTxArgs, password string, newSignerPubKey string) (string, error)
GetAssetContractData(chainID uint64, contractAddress string) (*AssetContractData, error)
SafeGetSignerPubKey(ctx context.Context, chainID uint64, communityID string) (string, error)
DeploymentSignatureDigest(chainID uint64, addressFrom string, communityID string) ([]byte, error)
Expand Down
5 changes: 0 additions & 5 deletions protocol/communities_messenger_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
walletCommon "github.com/status-im/status-go/services/wallet/common"
"github.com/status-im/status-go/services/wallet/thirdparty"
walletToken "github.com/status-im/status-go/services/wallet/token"
"github.com/status-im/status-go/services/wallet/wallettypes"

wakutypes "github.com/status-im/status-go/waku/types"
)
Expand Down Expand Up @@ -203,10 +202,6 @@ func (c *CollectiblesServiceMock) SetSignerPubkeyForCommunity(communityID []byte
c.Signers[types.EncodeHex(communityID)] = signerPubKey
}

func (c *CollectiblesServiceMock) SetSignerPubKey(ctx context.Context, chainID uint64, contractAddress string, txArgs wallettypes.SendTxArgs, password string, newSignerPubKey string) (string, error) {
return "", nil
}

func (c *CollectiblesServiceMock) GetCollectibleContractData(chainID uint64, contractAddress string) (*communities.CollectibleContractData, error) {
collectibleContractData, dataExists := c.Collectibles[chainID][contractAddress]
if dataExists {
Expand Down
Loading

0 comments on commit 98e6579

Please sign in to comment.