-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/deposits start #74
Conversation
services/accounts.go
Outdated
@@ -472,7 +473,7 @@ func (s *Service) formatAccounts(opts *bind.FilterOpts) ([]*models.Account, erro | |||
|
|||
for iterator.Next() { | |||
if iterator.Error() != nil { | |||
logger.Log().WithField("layer", "Service-formatAccounts").Errorf("iterator error: %v", err.Error()) | |||
logger.Log().WithField("layer", "Service-formatAccounts").Errorf("iterator error: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats requires err.Error()
services/accounts.go
Outdated
@@ -498,7 +499,7 @@ func (s *Service) formatAccountsCore(opts *bind.FilterOpts) ([]*models.Account, | |||
|
|||
for iterator.Next() { | |||
if iterator.Error() != nil { | |||
logger.Log().WithField("layer", "Service-formatAccountsCore").Errorf("iterator error: %v", err.Error()) | |||
logger.Log().WithField("layer", "Service-formatAccountsCore").Errorf("iterator error: %s", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why was it changed?
services/collateral.go
Outdated
if fromBlock == 0 { | ||
fromBlock = s.coreFirstBlock | ||
} | ||
|
||
var withdraws []*models.CollateralWithdrawn | ||
|
||
logger.Log().WithField("layer", "Service-RetrieveCollateralWithdrawnLimit").Infof( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service-RetrieveCollateralWithdrawn instead of
"Service-RetrieveCollateralWithdrawnLimit
if endBlockOfIteration > toBlock { | ||
endBlockOfIteration = toBlock | ||
} | ||
|
||
for i := uint64(1); i <= iterations; i++ { | ||
if i%10 == 0 || i == iterations { | ||
logger.Log().WithField("layer", "Service-RetrieveCollateralWithdrawnLimit").Infof("-- iteration %v", i) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
services/collateral.go
Outdated
if fromBlock == 0 { | ||
fromBlock = s.coreFirstBlock | ||
} | ||
|
||
var deposits []*models.CollateralDeposited | ||
|
||
logger.Log().WithField("layer", "Service-RetrieveCollateralDepositedLimit").Infof( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service-RetrieveCollateralDepositedLimit here is incorrect
if endBlockOfIteration > toBlock { | ||
endBlockOfIteration = toBlock | ||
} | ||
|
||
for i := uint64(1); i <= iterations; i++ { | ||
if i%10 == 0 || i == iterations { | ||
logger.Log().WithField("layer", "Service-RetrieveCollateralDepositedLimit").Infof("-- iteration %v", i) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service-RetrieveCollateralDepositedLimit here is incorrect
services/pools.go
Outdated
if endBlockOfIteration > toBlock { | ||
endBlockOfIteration = toBlock | ||
} | ||
|
||
for i := uint64(1); i <= iterations; i++ { | ||
if i%10 == 0 || i == iterations { | ||
logger.Log().WithField("layer", "Service-RetrieveUSDMintedLimit").Infof("-- iteration %v", i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service-RetrieveUSDMintedLimit incorrect
services/pools.go
Outdated
@@ -27,16 +30,25 @@ func (s *Service) RetrieveUSDMintedLimit(limit uint64) ([]*models.USDMinted, err | |||
|
|||
logger.Log().WithField("layer", "Service-RetrieveUSDMintedLimit").Infof( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Service-RetrieveUSDMintedLimit incorrect
services/collateral.go
Outdated
} | ||
|
||
func (s *Service) RetrieveCollateralWithdrawn(fromBlock uint64, toBlock uint64, limit uint64) ([]*models.CollateralWithdrawn, error) { | ||
iterations, lastBlock, err := s.getIterationsForLimitQueryCore(limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be s.getIterationsForQuery
, instead of s.getIterationsForLimitQueryCore
Because s.getIterationsForLimitQueryCore
gives iterations in range from core contract's first block to RPC's last block
services/collateral.go
Outdated
} | ||
|
||
func (s *Service) RetrieveCollateralDeposited(fromBlock uint64, toBlock uint64, limit uint64) ([]*models.CollateralDeposited, error) { | ||
iterations, lastBlock, err := s.getIterationsForLimitQueryCore(limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
services/pools.go
Outdated
return s.RetrieveUSDMinted(0, 0, limit) | ||
} | ||
func (s *Service) RetrieveUSDMinted(fromBlock uint64, toBlock uint64, limit uint64) ([]*models.USDMinted, error) { | ||
iterations, lastBlock, err := s.getIterationsForLimitQueryCore(limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
services/pools.go
Outdated
} | ||
|
||
func (s *Service) RetrieveUSDBurned(fromBlock uint64, toBlock uint64, limit uint64) ([]*models.USDBurned, error) { | ||
iterations, lastBlock, err := s.getIterationsForLimitQueryCore(limit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
We should also add new functions (such as
|
No description provided.