Skip to content

Commit

Permalink
fix: HandleCommunityTokensMetadata
Browse files Browse the repository at this point in the history
Add all tokens in the loop.
Get MaxSupply instead of TotalSupply

Issue #12104
  • Loading branch information
endulab committed Oct 15, 2023
1 parent 176bdd2 commit f2464cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions protocol/communities/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -4712,7 +4712,6 @@ func (m *Manager) HandleCommunityTokensMetadata(community *Community) error {
if len(communityTokens) == 0 {
return nil
}

for _, tokenMetadata := range communityTokens {
for chainID, address := range tokenMetadata.ContractAddresses {
exists, err := m.persistence.HasCommunityToken(communityID, address, int(chainID))
Expand All @@ -4726,7 +4725,10 @@ func (m *Manager) HandleCommunityTokensMetadata(community *Community) error {
return err
}

return m.persistence.AddCommunityToken(communityToken)
err = m.persistence.AddCommunityToken(communityToken)
if err != nil {
return err
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions services/communitytokens/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (m *Manager) GetCollectibleContractData(chainID uint64, contractAddress str
if err != nil {
return nil, err
}
totalSupply, err := contract.TotalSupply(callOpts)
totalSupply, err := contract.MaxSupply(callOpts)
if err != nil {
return nil, err
}
Expand All @@ -105,7 +105,7 @@ func (m *Manager) GetAssetContractData(chainID uint64, contractAddress string) (
if err != nil {
return nil, err
}
totalSupply, err := contract.TotalSupply(callOpts)
totalSupply, err := contract.MaxSupply(callOpts)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f2464cc

Please sign in to comment.