fix(GetCommunityTokens): Change API call - use only communityId param
Fix #9725
This commit is contained in:
parent
9fbc4d51ee
commit
8a296407f3
|
@ -2696,8 +2696,8 @@ func findIndexFile(files []*torrent.File) (index int, ok bool) {
|
||||||
return 0, false
|
return 0, false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) GetCommunityTokens(communityID string, chainID int) ([]*CommunityToken, error) {
|
func (m *Manager) GetCommunityTokens(communityID string) ([]*CommunityToken, error) {
|
||||||
return m.persistence.GetCommunityTokens(communityID, chainID)
|
return m.persistence.GetCommunityTokens(communityID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Manager) AddCommunityToken(token *CommunityToken) error {
|
func (m *Manager) AddCommunityToken(token *CommunityToken) error {
|
||||||
|
|
|
@ -828,10 +828,10 @@ func (p *Persistence) GetCommunityChatIDs(communityID types.HexBytes) ([]string,
|
||||||
return ids, nil
|
return ids, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Persistence) GetCommunityTokens(communityID string, chainID int) ([]*CommunityToken, error) {
|
func (p *Persistence) GetCommunityTokens(communityID string) ([]*CommunityToken, error) {
|
||||||
rows, err := p.db.Query(`SELECT community_id, address, type, name, symbol, description, supply,
|
rows, err := p.db.Query(`SELECT community_id, address, type, name, symbol, description, supply,
|
||||||
infinite_supply, transferable, remote_self_destruct, chain_id, deploy_state, image_base64
|
infinite_supply, transferable, remote_self_destruct, chain_id, deploy_state, image_base64
|
||||||
FROM community_tokens WHERE community_id = ? AND chain_id = ?`, communityID, chainID)
|
FROM community_tokens WHERE community_id = ?`, communityID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -371,7 +371,7 @@ func (s *PersistenceSuite) TestUpdateCommunitySettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *PersistenceSuite) TestGetCommunityTokens() {
|
func (s *PersistenceSuite) TestGetCommunityTokens() {
|
||||||
tokens, err := s.db.GetCommunityTokens("123", 1)
|
tokens, err := s.db.GetCommunityTokens("123")
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
s.Require().Len(tokens, 0)
|
s.Require().Len(tokens, 0)
|
||||||
|
|
||||||
|
@ -412,14 +412,14 @@ func (s *PersistenceSuite) TestGetCommunityTokens() {
|
||||||
err = s.db.AddCommunityToken(&token2)
|
err = s.db.AddCommunityToken(&token2)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
|
|
||||||
tokens, err = s.db.GetCommunityTokens("123", 1)
|
tokens, err = s.db.GetCommunityTokens("123")
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
s.Require().Len(tokens, 1)
|
s.Require().Len(tokens, 1)
|
||||||
s.Require().Equal(token, *tokens[0])
|
s.Require().Equal(token, *tokens[0])
|
||||||
|
|
||||||
err = s.db.UpdateCommunityTokenState("0x123", Deployed)
|
err = s.db.UpdateCommunityTokenState("0x123", Deployed)
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
tokens, err = s.db.GetCommunityTokens("123", 1)
|
tokens, err = s.db.GetCommunityTokens("123")
|
||||||
s.Require().NoError(err)
|
s.Require().NoError(err)
|
||||||
s.Require().Len(tokens, 1)
|
s.Require().Len(tokens, 1)
|
||||||
s.Require().Equal(Deployed, tokens[0].DeployState)
|
s.Require().Equal(Deployed, tokens[0].DeployState)
|
||||||
|
|
|
@ -3334,8 +3334,8 @@ func (m *Messenger) chatMessagesToWakuMessages(chatMessages []*common.Message, c
|
||||||
return wakuMessages, nil
|
return wakuMessages, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Messenger) GetCommunityTokens(communityID string, chainID int) ([]*communities.CommunityToken, error) {
|
func (m *Messenger) GetCommunityTokens(communityID string) ([]*communities.CommunityToken, error) {
|
||||||
return m.communitiesManager.GetCommunityTokens(communityID, chainID)
|
return m.communitiesManager.GetCommunityTokens(communityID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *Messenger) AddCommunityToken(token *communities.CommunityToken) error {
|
func (m *Messenger) AddCommunityToken(token *communities.CommunityToken) error {
|
||||||
|
|
|
@ -1260,8 +1260,8 @@ func (api *PublicAPI) BuildContact(publicKey string) (*protocol.Contact, error)
|
||||||
return api.service.messenger.BuildContact(publicKey)
|
return api.service.messenger.BuildContact(publicKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *PublicAPI) GetCommunityTokens(communityID string, chainID int) ([]*communities.CommunityToken, error) {
|
func (api *PublicAPI) GetCommunityTokens(communityID string) ([]*communities.CommunityToken, error) {
|
||||||
return api.service.messenger.GetCommunityTokens(communityID, chainID)
|
return api.service.messenger.GetCommunityTokens(communityID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (api *PublicAPI) AddCommunityToken(token *communities.CommunityToken) error {
|
func (api *PublicAPI) AddCommunityToken(token *communities.CommunityToken) error {
|
||||||
|
|
Loading…
Reference in New Issue