fix: Use correct chains when checking permissions: mainnet or testnet (#4793)
Fix #18896
This commit is contained in:
parent
3959948c4c
commit
ba7faea027
|
@ -155,9 +155,16 @@ func (m *DefaultTokenManager) GetAllChainIDs() ([]uint64, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
areTestNetworksEnabled, err := m.tokenManager.RPCClient.NetworkManager.GetTestNetworksEnabled()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
chainIDs := make([]uint64, 0)
|
chainIDs := make([]uint64, 0)
|
||||||
for _, network := range networks {
|
for _, network := range networks {
|
||||||
chainIDs = append(chainIDs, network.ChainID)
|
if areTestNetworksEnabled == network.IsTest {
|
||||||
|
chainIDs = append(chainIDs, network.ChainID)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return chainIDs, nil
|
return chainIDs, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -320,3 +320,7 @@ func (nm *Manager) GetCombinedNetworks() ([]*CombinedNetwork, error) {
|
||||||
func (nm *Manager) GetConfiguredNetworks() []params.Network {
|
func (nm *Manager) GetConfiguredNetworks() []params.Network {
|
||||||
return nm.configuredNetworks
|
return nm.configuredNetworks
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (nm *Manager) GetTestNetworksEnabled() (result bool, err error) {
|
||||||
|
return nm.accountsDB.GetTestNetworksEnabled()
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue