fix moonbeam ratelimit (#269)

This commit is contained in:
walker-16 2023-04-27 11:17:31 -03:00 committed by GitHub
parent 45af329b56
commit c0ec64c749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 16 deletions

View File

@ -132,6 +132,7 @@ type rateLimitConfig struct {
terra int
aptos int
oasis int
moonbeam int
}
func newWatchers(config *config.Configuration, repo *storage.Repository, logger *zap.Logger) []watcher.ContractWatcher {
@ -207,7 +208,7 @@ func newWatchers(config *config.Configuration, repo *storage.Repository, logger
// add moonbeam watcher
if watchers.moonbeam != nil {
moonbeamLimiter := ratelimit.New(watchers.rateLimit.oasis, ratelimit.Per(time.Second))
moonbeamLimiter := ratelimit.New(watchers.rateLimit.moonbeam, ratelimit.Per(time.Second))
moonbeamClient := evm.NewEvmSDK(config.MoonbeamUrl, moonbeamLimiter)
params := watcher.EVMParams{
ChainID: watchers.moonbeam.chainID,
@ -242,6 +243,7 @@ func newEVMWatchersForMainnet() *watchersConfig {
terra: 10,
aptos: 3,
oasis: 3,
moonbeam: 5,
},
}
}
@ -265,6 +267,7 @@ func newEVMWatchersForTestnet() *watchersConfig {
terra: 5,
aptos: 1,
oasis: 1,
moonbeam: 2,
},
}
}