diff options
author | Javier Peletier <jpeletier@users.noreply.github.com> | 2018-12-12 23:22:17 +0800 |
---|---|---|
committer | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-12-12 23:22:17 +0800 |
commit | 4e6f53ac3360c4e90fdb419e7073e4316b2a49f7 (patch) | |
tree | d42606f412bad9137873d58929c52bb031b6f1eb /swarm/storage/feed/request.go | |
parent | ebbf3dfafb9af891294fa10c04b3c07dd56d8fdc (diff) | |
download | dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.tar dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.tar.gz dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.tar.bz2 dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.tar.lz dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.tar.xz dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.tar.zst dexon-4e6f53ac3360c4e90fdb419e7073e4316b2a49f7.zip |
swarm/storage: simplify ChunkValidator interface (#18285)
Diffstat (limited to 'swarm/storage/feed/request.go')
-rw-r--r-- | swarm/storage/feed/request.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/swarm/storage/feed/request.go b/swarm/storage/feed/request.go index 6968d8b9a..dd91a7cf4 100644 --- a/swarm/storage/feed/request.go +++ b/swarm/storage/feed/request.go @@ -171,9 +171,11 @@ func (r *Request) toChunk() (storage.Chunk, error) { } // fromChunk populates this structure from chunk data. It does not verify the signature is valid. -func (r *Request) fromChunk(updateAddr storage.Address, chunkdata []byte) error { +func (r *Request) fromChunk(chunk storage.Chunk) error { // for update chunk layout see Request definition + chunkdata := chunk.Data() + //deserialize the feed update portion if err := r.Update.binaryGet(chunkdata[:len(chunkdata)-signatureLength]); err != nil { return err @@ -189,7 +191,7 @@ func (r *Request) fromChunk(updateAddr storage.Address, chunkdata []byte) error } r.Signature = signature - r.idAddr = updateAddr + r.idAddr = chunk.Address() r.binaryData = chunkdata return nil |