From 5be79693ca4deac6a4dafc0cf806647fce9d90a8 Mon Sep 17 00:00:00 2001 From: v Date: Sat, 22 Jun 2024 00:41:44 +0200 Subject: [PATCH] fix check already fetched states --- constants/version.go | 2 +- store/store.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/constants/version.go b/constants/version.go index f4e6f46..672f776 100644 --- a/constants/version.go +++ b/constants/version.go @@ -1,6 +1,6 @@ package constants const ( - VERSION = "0.0.8" + VERSION = "0.0.9" CODENAME = "ogun" ) diff --git a/store/store.go b/store/store.go index 1057f4f..6fda020 100644 --- a/store/store.go +++ b/store/store.go @@ -46,7 +46,7 @@ func NewStore(config *configuration.Runtime) (*Store, error) { func (s *Store) GetDelegationState(delegate tezos.Address, cycle int64) (*StoredDelegationState, error) { var state StoredDelegationState - if err := s.db.Where("delegate = ? AND cycle = ?", delegate, cycle).First(&state).Error; err != nil { + if err := s.db.Model(&StoredDelegationState{}).Where("delegate = ? AND cycle = ?", delegate, cycle).First(&state).Error; err != nil { if err == gorm.ErrRecordNotFound { return nil, errors.Join(constants.ErrNotFound, err) }