Skip to content

Commit

Permalink
refactor: BatchId to PostageId
Browse files Browse the repository at this point in the history
  • Loading branch information
nugaon committed Oct 5, 2023
1 parent 4afe1b4 commit ba9708c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pkg/api/rchash.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func renderProof(proof redistribution.Proof) Proof {
ChunkSpan: proof.ChunkSpan,
PostageProof: PostageProof{
Signature: toHex(proof.PostageProof.Signature),
BatchID: toHex(proof.PostageProof.BatchId[:]),
BatchID: toHex(proof.PostageProof.PostageId[:]),
Index: strconv.FormatUint(proof.PostageProof.Index, 16),
TimeStamp: strconv.FormatUint(proof.PostageProof.TimeStamp, 16),
},
Expand Down
4 changes: 2 additions & 2 deletions pkg/storageincentives/redistribution/abi_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Proof struct {
// corresponding structure (of the same name) in Redistribution.sol smart contract.
type PostageProof struct {
Signature []byte `json:"signature"`
BatchId common.Hash `json:"batchId"`
PostageId common.Hash `json:"batchId"`
Index uint64 `json:"index"`
TimeStamp uint64 `json:"timeStamp"`
}
Expand Down Expand Up @@ -78,7 +78,7 @@ func NewProof(wp1, wp2, wp3 bmt.Proof, stamp swarm.Stamp, sch *soc.SOC) Proof {
ChunkSpan: binary.LittleEndian.Uint64(wp2.Span[:swarm.SpanSize]), // should be uint64 on the other size; copied from pkg/api/bytes.go
PostageProof: PostageProof{
Signature: stamp.Sig(),
BatchId: bytes32(stamp.BatchID())[0],
PostageId: bytes32(stamp.BatchID())[0],
Index: binary.BigEndian.Uint64(stamp.Index()),
TimeStamp: binary.BigEndian.Uint64(stamp.Timestamp()),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func randProof(t *testing.T) redistribution.Proof {
ProofSegments3: randomHashes(t, 7),
PostageProof: redistribution.PostageProof{
Signature: testutil.RandBytes(t, 65),
BatchId: randomHashes(t, 1)[0],
PostageId: randomHashes(t, 1)[0],
Index: uint64(rand.Int63()),
TimeStamp: uint64(rand.Int63()),
},
Expand Down

0 comments on commit ba9708c

Please sign in to comment.