From f59bb6fa0080ee17ddf1d673dcc826265ad978db Mon Sep 17 00:00:00 2001 From: j-rafique Date: Fri, 5 Jul 2024 19:46:59 +0500 Subject: [PATCH] [PSl-1207] fix ticket db txid --- common/storage/ticketstore/files.go | 3 +-- walletnode/api/services/cascade.go | 5 +++-- walletnode/services/cascaderegister/service.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/storage/ticketstore/files.go b/common/storage/ticketstore/files.go index 108c1a247..106feffa5 100644 --- a/common/storage/ticketstore/files.go +++ b/common/storage/ticketstore/files.go @@ -44,8 +44,7 @@ func (s *TicketStore) UpsertFile(file types.File) error { size_of_original_big_file = COALESCE(excluded.size_of_original_big_file, files.size_of_original_big_file), data_type_of_original_big_file = COALESCE(excluded.data_type_of_original_big_file, files.data_type_of_original_big_file), start_block = COALESCE(excluded.start_block, files.start_block), - done_block = COALESCE(excluded.done_block, files.done_block), - txid = COALESCE(excluded.txid, files.txid);` + done_block = COALESCE(excluded.done_block, files.done_block);` _, err := s.db.Exec(upsertQuery, file.FileID, file.UploadTimestamp, file.Path, file.FileIndex, file.BaseFileID, file.TaskID, diff --git a/walletnode/api/services/cascade.go b/walletnode/api/services/cascade.go index 8a529b1ec..60ab3e675 100644 --- a/walletnode/api/services/cascade.go +++ b/walletnode/api/services/cascade.go @@ -4,13 +4,14 @@ import ( "context" "encoding/hex" "fmt" - "github.com/pastelnetwork/gonode/common/types" "os" "path/filepath" "strings" "sync" "time" + "github.com/pastelnetwork/gonode/common/types" + "github.com/gorilla/websocket" "github.com/pastelnetwork/gonode/common/errors" "github.com/pastelnetwork/gonode/common/log" @@ -606,7 +607,7 @@ func (service *CascadeAPIHandler) RestoreFiles(ctx context.Context, p *cascade.R Passphrase: p.Key, } - err = service.register.ActivateActionTicketAndRegisterVolumeTicket(ctx, activateActReq, *unConcludedVolume, actAttemptId) + err = service.register.ActivateActionTicket(ctx, activateActReq, *unConcludedVolume, actAttemptId) if err != nil { log.WithContext(ctx).WithField("file_id", unConcludedVolume.FileID).WithError(err).Error("error activating or registering un-concluded volume") continue diff --git a/walletnode/services/cascaderegister/service.go b/walletnode/services/cascaderegister/service.go index 1c8d6cb2a..907b6aeb0 100644 --- a/walletnode/services/cascaderegister/service.go +++ b/walletnode/services/cascaderegister/service.go @@ -595,7 +595,7 @@ func (service *CascadeRegistrationService) GetBurnTxIdByAmount(ctx context.Conte return txID, nil } -func (service *CascadeRegistrationService) ActivateActionTicketAndRegisterVolumeTicket(ctx context.Context, aar pastel.ActivateActionRequest, baseFile types.File, actAttemptId int64) error { +func (service *CascadeRegistrationService) ActivateActionTicket(ctx context.Context, aar pastel.ActivateActionRequest, baseFile types.File, actAttemptId int64) error { blockCount, err := service.pastelHandler.PastelClient.GetBlockCount(ctx) if err != nil { return err