From 23dd2c061665ec44d6d94c9e44a25e7a04ecba48 Mon Sep 17 00:00:00 2001 From: Ezra Smith Date: Wed, 18 Sep 2024 10:36:41 -0400 Subject: [PATCH] Fix recursive driver.Valuer implementations --- service/persist/contract.go | 2 +- service/persist/token.go | 2 +- service/persist/user.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/service/persist/contract.go b/service/persist/contract.go index 6e7ef035c..771980a8b 100644 --- a/service/persist/contract.go +++ b/service/persist/contract.go @@ -48,7 +48,7 @@ const ( // Value implements the driver.Valuer interface for the Chain type func (c ContractOwnerMethod) Value() (driver.Value, error) { - return c, nil + return int64(c), nil } // Scan implements the sql.Scanner interface for the Chain type diff --git a/service/persist/token.go b/service/persist/token.go index b6846193f..937a063a7 100644 --- a/service/persist/token.go +++ b/service/persist/token.go @@ -499,7 +499,7 @@ func (c Chain) BaseKeywords() (image []string, anim []string) { // Value implements the driver.Valuer interface for the Chain type func (c Chain) Value() (driver.Value, error) { - return c, nil + return int64(c), nil } // Scan implements the sql.Scanner interface for the Chain type diff --git a/service/persist/user.go b/service/persist/user.go index 4037b85b0..2614394aa 100644 --- a/service/persist/user.go +++ b/service/persist/user.go @@ -309,8 +309,8 @@ func (r *Role) Scan(i interface{}) error { } // Value implements the database/sql driver Valuer interface for the DBID type -func (r *Role) Value() (driver.Value, error) { - return r, nil +func (r Role) Value() (driver.Value, error) { + return string(r), nil } // UnmarshalGQL implements the graphql.Unmarshaler interface @@ -380,8 +380,8 @@ func (p *Persona) Scan(i interface{}) error { } // Value implements the database/sql driver Valuer interface for the Persona type -func (p *Persona) Value() (driver.Value, error) { - return p, nil +func (p Persona) Value() (driver.Value, error) { + return string(p), nil } // UnmarshalGQL implements the graphql.Unmarshaler interface