fix: HandleCommunityTokensMetadata

Add all tokens in the loop.
Get MaxSupply instead of TotalSupply

Issue #12104
This commit is contained in:
Michal Iskierko 2023-10-04 10:26:38 +02:00 committed by Michał Iskierko
parent 176bdd297d
commit f2464cccfd
2 changed files with 6 additions and 4 deletions

View File

@ -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))
@ -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
}
}
}
}

View File

@ -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
}
@ -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
}