Skip to content

Commit

Permalink
fix check already fetched states
Browse files Browse the repository at this point in the history
  • Loading branch information
cryi committed Jun 21, 2024
1 parent 9e84ec4 commit 5be7969
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion constants/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package constants

const (
VERSION = "0.0.8"
VERSION = "0.0.9"
CODENAME = "ogun"
)
2 changes: 1 addition & 1 deletion store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 5be7969

Please sign in to comment.