Skip to content

Commit

Permalink
Hotfix: storing delegates
Browse files Browse the repository at this point in the history
  • Loading branch information
gov-dmitry committed Oct 25, 2024
1 parent 4dae065 commit b086699
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/delegate/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ func (r *Repo) CreateHistory(tx *gorm.DB, dd History) error {
}

// CreateSummary creates one summary info
func (r *Repo) CreateSummary(sm Summary) error {
return r.db.Create(&sm).Error
func (r *Repo) CreateSummary(tx *gorm.DB, sm Summary) error {
return tx.Create(&sm).Error
}

func (r *Repo) CallInTx(cb func(tx *gorm.DB) error) error {
Expand Down
2 changes: 1 addition & 1 deletion internal/delegate/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (s *Service) handleDelegate(_ context.Context, hr History) error {

for _, info := range hr.Delegations.Details {
addresses = append(addresses, info.Address)
if err = s.repo.CreateSummary(Summary{
if err = s.repo.CreateSummary(tx, Summary{
AddressFrom: strings.ToLower(hr.AddressFrom),
AddressTo: strings.ToLower(info.Address),
DaoID: daoID.String(),
Expand Down

0 comments on commit b086699

Please sign in to comment.