@@ -6,7 +6,6 @@ package feeds
66
77import (
88 "context"
9- "encoding/binary"
109 "errors"
1110 "fmt"
1211 "time"
@@ -60,7 +59,7 @@ func GetWrappedChunk(ctx context.Context, getter storage.Getter, ch swarm.Chunk)
6059 // possible values right now:
6160 // unencrypted ref: span+timestamp+ref => 8+8+32=48
6261 // encrypted ref: span+timestamp+ref+decryptKey => 8+8+64=80
63- _ , ref , err := LegacyPayload (wc )
62+ ref , err := legacyPayload (wc )
6463 if err != nil {
6564 if errors .Is (err , errNotLegacyPayload ) {
6665 return wc , nil
@@ -84,14 +83,12 @@ func FromChunk(ch swarm.Chunk) (swarm.Chunk, error) {
8483 return s .WrappedChunk (), nil
8584}
8685
87- // LegacyPayload returns back the referenced chunk and datetime from the legacy feed payload
88- func LegacyPayload (wrappedChunk swarm.Chunk ) (uint64 , swarm.Address , error ) {
86+ // legacyPayload returns back the referenced chunk and datetime from the legacy feed payload
87+ func legacyPayload (wrappedChunk swarm.Chunk ) (swarm.Address , error ) {
8988 cacData := wrappedChunk .Data ()
9089 if ! (len (cacData ) == 16 + swarm .HashSize || len (cacData ) == 16 + swarm .HashSize * 2 ) {
91- return 0 , swarm .ZeroAddress , errNotLegacyPayload
90+ return swarm .ZeroAddress , errNotLegacyPayload
9291 }
93- address := swarm .NewAddress (cacData [16 :])
94- at := binary .BigEndian .Uint64 (cacData [8 :16 ])
9592
96- return at , address , nil
93+ return swarm . NewAddress ( cacData [ 16 :]) , nil
9794}
0 commit comments