gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taldir] 02/02: cleanup


From: gnunet
Subject: [taler-taldir] 02/02: cleanup
Date: Sun, 17 Jul 2022 17:37:27 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository taldir.

commit bc7c627f5cae762e4bfa30f11e81013701d2d51a
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sun Jul 17 17:37:21 2022 +0200

    cleanup
---
 pkg/rest/taldir.go | 20 --------------------
 1 file changed, 20 deletions(-)

diff --git a/pkg/rest/taldir.go b/pkg/rest/taldir.go
index dc692b0..9f18f34 100644
--- a/pkg/rest/taldir.go
+++ b/pkg/rest/taldir.go
@@ -211,20 +211,6 @@ type validation struct {
 }
 
 
-type validationMetadata struct {
-  // ORM
-  gorm.Model `json:"-"`
-
-  // The hash (SHA512) of the address
-  HAddress string `json:"h_address"`
-
-  // When does this validation timeframe begin (for retry calculation)
-  TimeframeStart time.Time
-
-  // How often was this validation re-initiated for this address
-  InitiationCount int
-}
-
 // ErrorDetail is the detailed error payload returned from Taldir endpoints
 type ErrorDetail struct {
 
@@ -459,7 +445,6 @@ func (t *Taldir) registerRequest(w http.ResponseWriter, r 
*http.Request){
     t.Db.Delete(&validation)
     return
   }
-  // FIXME try to avoid validationMetadata
   err = t.Db.First(&validation, "h_address = ? AND public_key = ? AND inbox = 
? AND duration = ?",
                                 hAddress, req.PublicKey, req.Inbox, 
reqDuration).Error
   validationExists := (nil == err)
@@ -604,7 +589,6 @@ func (t *Taldir) validationPage(w http.ResponseWriter, r 
*http.Request) {
 func (t *Taldir) ClearDatabase() {
   t.Db.Where("1 = 1").Delete(&entry{})
   t.Db.Where("1 = 1").Delete(&validation{})
-  t.Db.Where("1 = 1").Delete(&validationMetadata{})
 }
 
 func (t *Taldir) termsResponse(w http.ResponseWriter, r *http.Request) {
@@ -770,10 +754,6 @@ func (t *Taldir) Initialize(cfgfile string) {
   if err := t.Db.AutoMigrate(&validation{}); err != nil {
     panic(err)
   }
-  if err := t.Db.AutoMigrate(&validationMetadata{}); err != nil {
-    panic(err)
-  }
-
 
   // Clean up validations
   validationExpStr := 
t.Cfg.Section("taldir").Key("validation_expiration").MustString("24h")

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]