@@ -13,6 +13,7 @@ import (
1313 "github.com/0chain/blobber/code/go/0chain.net/core/logging"
1414 "github.com/0chain/blobber/code/go/0chain.net/core/node"
1515 "github.com/0chain/blobber/code/go/0chain.net/core/transaction"
16+ "go.uber.org/zap"
1617 "gorm.io/gorm"
1718)
1819
@@ -110,8 +111,9 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
110111 a .TimeUnit = sa .TimeUnit
111112 a .FileOptions = sa .FileOptions
112113 a .StartTime = sa .StartTime
113- // Only for testing purpose
114114 a .StorageVersion = uint8 (sa .StorageVersion )
115+ a .OwnerSigningPublicKey = sa .OwnerSigningPublicKey
116+ logging .Logger .Info ("OwnerSigningPublicKey" , zap .String ("OwnerSigningPublicKey" , a .OwnerSigningPublicKey ), zap .String ("allocation_id" , a .ID ))
115117
116118 m := map [string ]interface {}{
117119 "allocation_id" : a .ID ,
@@ -139,23 +141,24 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
139141 return a , nil
140142 }
141143
142- logging .Logger .Info ("Saving the allocation to DB" )
144+ logging .Logger .Info ("Saving the allocation to DB" , zap . String ( "allocation_id" , a . ID ) )
143145
144146 if ! isExist {
145147 err = Repo .Save (ctx , a )
146148 } else {
147149 updateMap := map [string ]interface {}{
148- "tx" : a .Tx ,
149- "expiration_date" : a .Expiration ,
150- "owner_id" : a .OwnerID ,
151- "owner_public_key" : a .OwnerPublicKey ,
152- "repairer_id" : a .RepairerID ,
153- "size" : a .TotalSize ,
154- "finalized" : a .Finalized ,
155- "time_unit" : a .TimeUnit ,
156- "file_options" : a .FileOptions ,
157- "start_time" : a .StartTime ,
158- "blobber_size" : a .BlobberSize ,
150+ "tx" : a .Tx ,
151+ "expiration_date" : a .Expiration ,
152+ "owner_id" : a .OwnerID ,
153+ "owner_public_key" : a .OwnerPublicKey ,
154+ "repairer_id" : a .RepairerID ,
155+ "size" : a .TotalSize ,
156+ "finalized" : a .Finalized ,
157+ "time_unit" : a .TimeUnit ,
158+ "file_options" : a .FileOptions ,
159+ "start_time" : a .StartTime ,
160+ "blobber_size" : a .BlobberSize ,
161+ "owner_signing_public_key" : a .OwnerSigningPublicKey ,
159162 }
160163
161164 updateOption := func (alloc * Allocation ) {
@@ -170,6 +173,7 @@ func FetchAllocationFromEventsDB(ctx context.Context, allocationID string, alloc
170173 alloc .FileOptions = a .FileOptions
171174 alloc .StartTime = a .StartTime
172175 alloc .BlobberSize = a .BlobberSize
176+ alloc .OwnerSigningPublicKey = a .OwnerSigningPublicKey
173177 }
174178 err = Repo .UpdateAllocation (ctx , a , updateMap , updateOption )
175179 }
0 commit comments