From 2cbced95c55463a4f1c92b04e1b8669a4eb97897 Mon Sep 17 00:00:00 2001 From: Pascal Precht <445106+0x-r4bbit@users.noreply.github.com> Date: Thu, 16 Mar 2023 15:35:33 +0100 Subject: [PATCH] Check token funds when handling community requests to join This adds checks to `HandleCommunityRequestToJoin` and `AcceptRequestToJoinCommunity` that ensure a given user's revealed wallet addresses own the token funds required by a community. When community has token permissions of type `BECOME_MEMBER`, the following happens when the owner receives a request: 1. Upon verifying provided wallet addresses by the requester, the owner node accumulates all token funds related to the given wallets that match the token criteria in the configured permissions 2. If the requester does not meet the necessary requirements, the request to join will be declined. If the requester does have the funds, he'll either be automatically accepted to the community, or enters the next stage where an owner needs to manually accept the request. 3. The the community does not automatically accept users, then the funds check will happen again, when the owner tries to manually accept the request. If the necessary funds do not exist at this stage, the request will be declined 4. Upon accepting, whether automatically or manually, the owner adds the requester's wallet addresses to the `CommunityDescription`, such that they can be retrieved later when doing periodic checks or when permissions have changed. --- api/geth_backend.go | 2 +- cmd/statusd/main.go | 1 + protocol/communities/community.go | 26 +++ protocol/communities/errors.go | 3 + protocol/communities/manager.go | 184 ++++++++++++++++++++- protocol/messenger.go | 5 + protocol/messenger_communities.go | 18 +- protocol/protobuf/communities.pb.go | 248 +++++++++++++++------------- protocol/protobuf/communities.proto | 1 + services/ext/service.go | 2 +- services/wakuext/api_test.go | 4 +- 11 files changed, 367 insertions(+), 127 deletions(-) diff --git a/api/geth_backend.go b/api/geth_backend.go index efee85b3a..c839ad939 100644 --- a/api/geth_backend.go +++ b/api/geth_backend.go @@ -1606,7 +1606,7 @@ func (b *GethStatusBackend) injectAccountsIntoWakuService(w types.WakuKeyManager } if st != nil { - if err := st.InitProtocol(b.statusNode.GethNode().Config().Name, identity, b.appDB, b.statusNode.HTTPServer(), b.multiaccountsDB, acc, b.accountManager, logutils.ZapLogger()); err != nil { + if err := st.InitProtocol(b.statusNode.GethNode().Config().Name, identity, b.appDB, b.statusNode.HTTPServer(), b.multiaccountsDB, acc, b.accountManager, b.statusNode.RPCClient(), logutils.ZapLogger()); err != nil { return err } // Set initial connection state diff --git a/cmd/statusd/main.go b/cmd/statusd/main.go index 2a6926526..33d6dfe30 100644 --- a/cmd/statusd/main.go +++ b/cmd/statusd/main.go @@ -218,6 +218,7 @@ func main() { protocol.WithPushNotificationServerConfig(&config.PushNotificationServerConfig), protocol.WithDatabase(db), protocol.WithTorrentConfig(&config.TorrentConfig), + protocol.WithRPCClient(backend.StatusNode().RPCClient()), } messenger, err := protocol.NewMessenger( diff --git a/protocol/communities/community.go b/protocol/communities/community.go index 3136cf732..ccaeae6f4 100644 --- a/protocol/communities/community.go +++ b/protocol/communities/community.go @@ -455,6 +455,9 @@ type CommunityChanges struct { CategoriesAdded map[string]*protobuf.CommunityCategory `json:"categoriesAdded"` CategoriesModified map[string]*protobuf.CommunityCategory `json:"categoriesModified"` + MemberWalletsRemoved []string `json:"memberWalletsRemoved"` + MemberWalletsAdded map[string][]string `json:"memberWalletsAdded"` + // ShouldMemberJoin indicates whether the user should join this community // automatically ShouldMemberJoin bool `json:"memberAdded"` @@ -1808,6 +1811,26 @@ func (o *Community) AllowsAllMembersToPinMessage() bool { return o.config.CommunityDescription.AdminSettings != nil && o.config.CommunityDescription.AdminSettings.PinMessageAllMembersEnabled } +func (o *Community) AddMemberWallet(memberID string, addresses []string) (*CommunityChanges, error) { + o.mutex.Lock() + defer o.mutex.Unlock() + + if o.config.PrivateKey == nil { + return nil, ErrNotAdmin + } + + if _, ok := o.config.CommunityDescription.Members[memberID]; !ok { + return nil, ErrMemberNotFound + } + + o.config.CommunityDescription.Members[memberID].WalletAccounts = addresses + o.increaseClock() + + changes := o.emptyCommunityChanges() + changes.MemberWalletsAdded[memberID] = o.config.CommunityDescription.Members[memberID].WalletAccounts + return changes, nil +} + func emptyCommunityChanges() *CommunityChanges { return &CommunityChanges{ MembersAdded: make(map[string]*protobuf.CommunityMember), @@ -1820,6 +1843,9 @@ func emptyCommunityChanges() *CommunityChanges { CategoriesRemoved: []string{}, CategoriesAdded: make(map[string]*protobuf.CommunityCategory), CategoriesModified: make(map[string]*protobuf.CommunityCategory), + + MemberWalletsRemoved: []string{}, + MemberWalletsAdded: make(map[string][]string), } } diff --git a/protocol/communities/errors.go b/protocol/communities/errors.go index 3c94f09a2..9e8526dfa 100644 --- a/protocol/communities/errors.go +++ b/protocol/communities/errors.go @@ -31,3 +31,6 @@ var ErrInvalidMessage = errors.New("invalid community description message") var ErrMemberNotFound = errors.New("member not found") var ErrTokenPermissionAlreadyExists = errors.New("token permission already exists") var ErrTokenPermissionNotFound = errors.New("token permission not found") +var ErrNoPermissionToJoin = errors.New("member has no permission to join") +var ErrMemberWalletAlreadyExists = errors.New("member wallet already exists") +var ErrMemberWalletNotFound = errors.New("member wallet not found") diff --git a/protocol/communities/manager.go b/protocol/communities/manager.go index 29556563f..d860164d2 100644 --- a/protocol/communities/manager.go +++ b/protocol/communities/manager.go @@ -1,13 +1,17 @@ package communities import ( + "context" "crypto/ecdsa" "database/sql" "fmt" "io/ioutil" + "math" + "math/big" "net" "os" "sort" + "strconv" "strings" "sync" "time" @@ -21,6 +25,7 @@ import ( "github.com/pkg/errors" "go.uber.org/zap" + gethcommon "github.com/ethereum/go-ethereum/common" "github.com/status-im/status-go/account" "github.com/status-im/status-go/eth-node/crypto" "github.com/status-im/status-go/eth-node/types" @@ -32,6 +37,7 @@ import ( "github.com/status-im/status-go/protocol/protobuf" "github.com/status-im/status-go/protocol/requests" "github.com/status-im/status-go/protocol/transport" + "github.com/status-im/status-go/services/wallet/token" "github.com/status-im/status-go/signal" ) @@ -53,6 +59,7 @@ type Manager struct { ensVerifier *ens.Verifier identity *ecdsa.PrivateKey accountsManager *account.GethManager + tokenManager *token.Manager logger *zap.Logger stdoutLogger *zap.Logger transport *transport.Transport @@ -87,6 +94,7 @@ func (t *HistoryArchiveDownloadTask) Cancel() { type managerOptions struct { accountsManager *account.GethManager + tokenManager *token.Manager } type ManagerOption func(*managerOptions) @@ -97,6 +105,12 @@ func WithAccountManager(accountsManager *account.GethManager) ManagerOption { } } +func WithTokenManager(tokenManager *token.Manager) ManagerOption { + return func(opts *managerOptions) { + opts.tokenManager = tokenManager + } +} + func NewManager(identity *ecdsa.PrivateKey, db *sql.DB, encryptor *encryption.Protocol, logger *zap.Logger, verifier *ens.Verifier, transport *transport.Transport, torrentConfig *params.TorrentConfig, opts ...ManagerOption) (*Manager, error) { if identity == nil { return nil, errors.New("empty identity") @@ -140,6 +154,10 @@ func NewManager(identity *ecdsa.PrivateKey, db *sql.DB, encryptor *encryption.Pr manager.accountsManager = managerConfig.accountsManager } + if managerConfig.tokenManager != nil { + manager.tokenManager = managerConfig.tokenManager + } + if verifier != nil { sub := verifier.Subscribe() @@ -1091,6 +1109,40 @@ func (m *Manager) AcceptRequestToJoin(request *requests.AcceptRequestToJoinCommu return nil, err } + becomeMemberPermissions := community.TokenPermissionsByType(protobuf.CommunityTokenPermission_BECOME_MEMBER) + addressesToAdd := make([]string, 0) + + if len(becomeMemberPermissions) > 0 { + revealedAddresses, err := m.persistence.GetRequestToJoinRevealedAddresses(dbRequest.ID) + if err != nil { + return nil, err + } + + walletAddresses := make([]gethcommon.Address, 0) + for _, walletAddress := range revealedAddresses { + walletAddresses = append(walletAddresses, gethcommon.HexToAddress(walletAddress)) + } + + hasPermission, err := m.checkPermissionToJoin(becomeMemberPermissions, walletAddresses) + if err != nil { + return nil, err + } + + if !hasPermission { + pk, err := common.HexToPubkey(dbRequest.PublicKey) + if err != nil { + return nil, err + } + err = m.markRequestToJoinAsCanceled(pk, community) + if err != nil { + return nil, err + } + return community, ErrNoPermissionToJoin + } + + addressesToAdd = append(addressesToAdd, revealedAddresses...) + } + pk, err := common.HexToPubkey(dbRequest.PublicKey) if err != nil { return nil, err @@ -1101,6 +1153,11 @@ func (m *Manager) AcceptRequestToJoin(request *requests.AcceptRequestToJoinCommu return nil, err } + _, err = community.AddMemberWallet(dbRequest.PublicKey, addressesToAdd) + if err != nil { + return nil, err + } + if err := m.markRequestToJoin(pk, community); err != nil { return nil, err } @@ -1228,6 +1285,27 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, request } } + // provided wallet addresses seem to be legit, so let's check + // if the necessary token permission funds exist + verifiedAddresses := make([]gethcommon.Address, 0) + for walletAddress := range request.RevealedAddresses { + verifiedAddresses = append(verifiedAddresses, gethcommon.HexToAddress(walletAddress)) + } + + hasPermission, err := m.checkPermissionToJoin(becomeMemberPermissions, verifiedAddresses) + if err != nil { + return nil, err + } + + if !hasPermission { + err = m.markRequestToJoinAsCanceled(signer, community) + if err != nil { + return nil, err + } + requestToJoin.State = RequestToJoinStateDeclined + return requestToJoin, nil + } + // Save revealed addresses + signatures so they can later be added // to the community member list when the request is accepted err = m.persistence.SaveRequestToJoinRevealedAddresses(requestToJoin) @@ -1235,7 +1313,7 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, request return nil, err } - if acceptAutomatically { + if hasPermission && acceptAutomatically { err = m.markRequestToJoin(signer, community) if err != nil { return nil, err @@ -1247,6 +1325,110 @@ func (m *Manager) HandleCommunityRequestToJoin(signer *ecdsa.PublicKey, request return requestToJoin, nil } +func (m *Manager) checkPermissionToJoin(permissions []*protobuf.CommunityTokenPermission, walletAddresses []gethcommon.Address) (bool, error) { + tokenAddresses, addressToSymbolMap := getTokenAddressesFromPermissions(permissions) + balances, err := m.getAccumulatedTokenBalances(walletAddresses, tokenAddresses, addressToSymbolMap) + if err != nil { + return false, err + } + + hasPermission := false + for _, tokenPermission := range permissions { + if checkTokenCriteria(tokenPermission.TokenCriteria, balances) { + hasPermission = true + break + } + } + + return hasPermission, nil +} + +func checkTokenCriteria(tokenCriteria []*protobuf.TokenCriteria, balances map[string]*big.Float) bool { + result := true + hasERC20 := false + for _, tokenRequirement := range tokenCriteria { + // we gotta check for whether there are ERC20 token criteria + // in the first place, if we don't we'll return a false positive + if tokenRequirement.Type == protobuf.CommunityTokenType_ERC20 { + hasERC20 = true + amount, _ := strconv.ParseFloat(tokenRequirement.Amount, 32) + if balances[tokenRequirement.Symbol].Cmp(big.NewFloat(amount)) == -1 { + result = false + break + } + } + } + return hasERC20 && result +} + +func (m *Manager) getAccumulatedTokenBalances(accounts []gethcommon.Address, tokenAddresses []gethcommon.Address, addressToToken map[gethcommon.Address]tokenData) (map[string]*big.Float, error) { + networks, err := m.tokenManager.RPCClient.NetworkManager.Get(false) + if err != nil { + return nil, err + } + + chainIDs := make([]uint64, 0) + for _, network := range networks { + chainIDs = append(chainIDs, network.ChainID) + } + + clients, err := m.tokenManager.RPCClient.EthClients(chainIDs) + if err != nil { + return nil, err + } + + balancesByChain, err := m.tokenManager.GetBalancesByChain(context.Background(), clients, accounts, tokenAddresses) + if err != nil { + return nil, err + } + + accumulatedBalances := make(map[string]*big.Float) + for _, accounts := range balancesByChain { + for _, contracts := range accounts { + for contract, value := range contracts { + if _, exists := accumulatedBalances[addressToToken[contract].Symbol]; !exists { + accumulatedBalances[addressToToken[contract].Symbol] = new(big.Float) + } + balance := new(big.Float).Quo( + new(big.Float).SetInt(value.ToInt()), + big.NewFloat(math.Pow(10, float64(addressToToken[contract].Decimals))), + ) + prevBalance := accumulatedBalances[addressToToken[contract].Symbol] + accumulatedBalances[addressToToken[contract].Symbol].Add(prevBalance, balance) + } + } + } + return accumulatedBalances, nil +} + +type tokenData struct { + Symbol string + Decimals int +} + +func getTokenAddressesFromPermissions(tokenPermissions []*protobuf.CommunityTokenPermission) ([]gethcommon.Address, map[gethcommon.Address]tokenData) { + set := make(map[gethcommon.Address]bool) + addressToToken := make(map[gethcommon.Address]tokenData) + for _, tokenPermission := range tokenPermissions { + for _, token := range tokenPermission.TokenCriteria { + if token.Type == protobuf.CommunityTokenType_ERC20 { + for _, contractAddress := range token.ContractAddresses { + set[gethcommon.HexToAddress(contractAddress)] = true + addressToToken[gethcommon.HexToAddress(contractAddress)] = tokenData{ + Symbol: token.Symbol, + Decimals: int(token.Decimals), + } + } + } + } + } + tokenAddresses := make([]gethcommon.Address, 0) + for tokenAddress := range set { + tokenAddresses = append(tokenAddresses, tokenAddress) + } + return tokenAddresses, addressToToken +} + func (m *Manager) HandleCommunityRequestToJoinResponse(signer *ecdsa.PublicKey, request *protobuf.CommunityRequestToJoinResponse) (*RequestToJoin, error) { pkString := common.PubkeyToHex(&m.identity.PublicKey) diff --git a/protocol/messenger.go b/protocol/messenger.go index 03f478b17..31b195c48 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -58,6 +58,7 @@ import ( "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" + "github.com/status-im/status-go/services/wallet/token" "github.com/status-im/status-go/telemetry" ) @@ -410,6 +411,10 @@ func NewMessenger( managerOptions := []communities.ManagerOption{ communities.WithAccountManager(accountsManager), } + if c.rpcClient != nil { + tokenManager := token.NewTokenManager(database, c.rpcClient, c.rpcClient.NetworkManager) + managerOptions = append(managerOptions, communities.WithTokenManager(tokenManager)) + } communitiesManager, err := communities.NewManager(identity, database, encryptionProtocol, logger, ensVerifier, transp, c.torrentConfig, managerOptions...) if err != nil { diff --git a/protocol/messenger_communities.go b/protocol/messenger_communities.go index 17c642fed..dd3f9e281 100644 --- a/protocol/messenger_communities.go +++ b/protocol/messenger_communities.go @@ -726,16 +726,28 @@ func (m *Messenger) AcceptRequestToJoinCommunity(request *requests.AcceptRequest return nil, err } - community, err := m.communitiesManager.AcceptRequestToJoin(request) + requestToJoin, err := m.communitiesManager.GetRequestToJoin(request.ID) if err != nil { return nil, err } - requestToJoin, err := m.communitiesManager.GetRequestToJoin(request.ID) - if err != nil { + community, err := m.communitiesManager.AcceptRequestToJoin(request) + if err != nil && err != communities.ErrNoPermissionToJoin { return nil, err } + if err == communities.ErrNoPermissionToJoin { + cancel := &requests.DeclineRequestToJoinCommunity{ + ID: requestToJoin.ID, + } + response, err := m.DeclineRequestToJoinCommunity(cancel) + if err != nil { + return nil, err + } + response.AddCommunity(community) + return response, nil + } + pk, err := common.HexToPubkey(requestToJoin.PublicKey) if err != nil { return nil, err diff --git a/protocol/protobuf/communities.pb.go b/protocol/protobuf/communities.pb.go index 99176e195..ca45b7695 100644 --- a/protocol/protobuf/communities.pb.go +++ b/protocol/protobuf/communities.pb.go @@ -175,6 +175,7 @@ func (m *Grant) GetClock() uint64 { type CommunityMember struct { Roles []CommunityMember_Roles `protobuf:"varint,1,rep,packed,name=roles,proto3,enum=protobuf.CommunityMember_Roles" json:"roles,omitempty"` + WalletAccounts []string `protobuf:"bytes,2,rep,name=wallet_accounts,json=walletAccounts,proto3" json:"wallet_accounts,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -212,6 +213,13 @@ func (m *CommunityMember) GetRoles() []CommunityMember_Roles { return nil } +func (m *CommunityMember) GetWalletAccounts() []string { + if m != nil { + return m.WalletAccounts + } + return nil +} + type CommunityTokenMetadata struct { ContractAddresses map[uint64]string `protobuf:"bytes,1,rep,name=contract_addresses,json=contractAddresses,proto3" json:"contract_addresses,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` @@ -1571,123 +1579,125 @@ func init() { } var fileDescriptor_f937943d74c1cd8b = []byte{ - // 1880 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x5f, 0x6f, 0x23, 0x49, - 0x11, 0xdf, 0xf1, 0x9f, 0xc4, 0x2e, 0xdb, 0x59, 0xa7, 0x77, 0x93, 0x4c, 0xb2, 0xbb, 0x97, 0xec, - 0x00, 0x22, 0x27, 0x84, 0x97, 0xcb, 0x81, 0x58, 0xdd, 0xc1, 0xdd, 0x79, 0x13, 0x6b, 0x31, 0x1b, - 0xdb, 0xb9, 0x8e, 0xc3, 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da, 0xe1, 0xcd, 0x16, 0x1c, 0x15, 0x00, 0x00, + // 1905 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcd, 0x72, 0x23, 0x49, + 0xf1, 0x9f, 0xd6, 0x87, 0x2d, 0xa5, 0x3e, 0x46, 0xae, 0x19, 0xdb, 0x6d, 0xcf, 0xcc, 0xda, 0xd3, + 0xff, 0x3f, 0xb1, 0xde, 0x20, 0xd0, 0xb0, 0x5a, 0x08, 0x26, 0x76, 0x61, 0x77, 0x35, 0xb6, 0x62, + 0x10, 0x63, 0x49, 0xde, 0xb2, 0xcc, 0xb2, 0x1b, 0x40, 0x47, 0xb9, 0xbb, 0x6c, 0x57, 0xb8, 0xd5, + 0x2d, 0xba, 0x4a, 0x06, 0x71, 0xe0, 0xc4, 0x43, 0x70, 0xe7, 0x4a, 0xf0, 0x0a, 0x1c, 0xe0, 0x48, + 0x70, 0x24, 0x82, 0x1b, 0x27, 0x82, 0xc7, 0x20, 0xea, 0xa3, 0xa5, 0x6e, 0x59, 0xb2, 0x87, 0x58, + 0x88, 0xe0, 0xa4, 0xce, 0xac, 0xcc, 0xac, 0xac, 0xcc, 0x5f, 0x65, 0x65, 0x0a, 0x36, 0xbc, 0x68, + 0x34, 0x9a, 0x84, 0x4c, 0x30, 0xca, 0x9b, 0xe3, 0x38, 0x12, 0x11, 0x2a, 0xa9, 0x9f, 0xf3, 0xc9, + 0xc5, 0xee, 0x23, 0xef, 0x8a, 0x08, 0x97, 0xf9, 0x34, 0x14, 0x4c, 0x4c, 0xf5, 0xf2, 0x6e, 0x85, + 0x86, 0x93, 0x91, 0x91, 0x75, 0x6e, 0xa0, 0xf8, 0x3a, 0x26, 0xa1, 0x40, 0xcf, 0xa1, 0x9a, 0x58, + 0x9a, 0xba, 0xcc, 0xb7, 0xad, 0x7d, 0xeb, 0xa0, 0x8a, 0x2b, 0x33, 0x5e, 0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0x15, 0x26, 0xba, 0x86, 0x92, 0x59, 0xe0, 0xec, 0x97, 0xd4, 0xfc, 0x19, 0xa7, 0xbe, + 0x17, 0x31, 0x52, 0x98, 0x61, 0xc4, 0xf9, 0x8b, 0x05, 0xdb, 0x2b, 0x4e, 0x81, 0xde, 0x40, 0xc9, + 0x0c, 0x0e, 0x49, 0xe3, 0xf2, 0xe2, 0x2e, 0x1f, 0x95, 0x52, 0xd3, 0x10, 0xa6, 0x5e, 0xcf, 0x0c, + 0xec, 0x5e, 0x40, 0x2d, 0xb3, 0xb4, 0xa4, 0x3a, 0x7f, 0x92, 0x6d, 0x09, 0xde, 0xbb, 0x77, 0xb3, + 0x59, 0x54, 0xe6, 0x85, 0xfc, 0x55, 0xed, 0xcb, 0x4a, 0xf3, 0xc5, 0x47, 0x89, 0xe6, 0xf9, 0x9a, + 0xfa, 0xfa, 0xe0, 0x5f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x53, 0xf5, 0x9f, 0xe9, 0x45, 0x15, 0x00, + 0x00, } diff --git a/protocol/protobuf/communities.proto b/protocol/protobuf/communities.proto index 27b6528f3..4df298771 100644 --- a/protocol/protobuf/communities.proto +++ b/protocol/protobuf/communities.proto @@ -21,6 +21,7 @@ message CommunityMember { ROLE_MODERATE_CONTENT = 3; } repeated Roles roles = 1; + repeated string wallet_accounts = 2; } message CommunityTokenMetadata { diff --git a/services/ext/service.go b/services/ext/service.go index 2a501e17a..b8c640bb9 100644 --- a/services/ext/service.go +++ b/services/ext/service.go @@ -108,7 +108,7 @@ func (s *Service) GetPeer(rawURL string) (*enode.Node, error) { return enode.ParseV4(rawURL) } -func (s *Service) InitProtocol(nodeName string, identity *ecdsa.PrivateKey, db *sql.DB, httpServer *server.MediaServer, multiAccountDb *multiaccounts.Database, acc *multiaccounts.Account, accountManager *account.GethManager, logger *zap.Logger) error { +func (s *Service) InitProtocol(nodeName string, identity *ecdsa.PrivateKey, db *sql.DB, httpServer *server.MediaServer, multiAccountDb *multiaccounts.Database, acc *multiaccounts.Account, accountManager *account.GethManager, rpcClient *rpc.Client, logger *zap.Logger) error { var err error if !s.config.ShhextConfig.PFSEnabled { return nil diff --git a/services/wakuext/api_test.go b/services/wakuext/api_test.go index 277e9a214..0d6aea289 100644 --- a/services/wakuext/api_test.go +++ b/services/wakuext/api_test.go @@ -137,7 +137,7 @@ func TestInitProtocol(t *testing.T) { acc := &multiaccounts.Account{KeyUID: "0xdeadbeef"} - err = service.InitProtocol("Test", privateKey, sqlDB, nil, multiAccounts, acc, nil, zap.NewNop()) + err = service.InitProtocol("Test", privateKey, sqlDB, nil, multiAccounts, acc, nil, nil, zap.NewNop()) require.NoError(t, err) } @@ -202,7 +202,7 @@ func (s *ShhExtSuite) createAndAddNode() { acc := &multiaccounts.Account{KeyUID: "0xdeadbeef"} - err = service.InitProtocol("Test", privateKey, sqlDB, nil, multiAccounts, acc, nil, zap.NewNop()) + err = service.InitProtocol("Test", privateKey, sqlDB, nil, multiAccounts, acc, nil, nil, zap.NewNop()) s.NoError(err) stack.RegisterLifecycle(service)