Skip to content

Commit

Permalink
embed unsigned chunk
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Kim <[email protected]>
  • Loading branch information
joshua-kim committed Nov 5, 2024
1 parent 9b1491b commit 1957065
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions x/dsmr/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,9 @@ type UnsignedChunk[T Tx] struct {

// TODO emit configurable amount of chunks/sec
type Chunk[T Tx] struct {
Producer ids.NodeID `serialize:"true"`
Beneficiary codec.Address `serialize:"true"`
Expiry int64 `serialize:"true"`
Txs []T `serialize:"true"`
Signer [bls.PublicKeyLen]byte `serialize:"true"`
Signature [bls.SignatureLen]byte `serialize:"true"`
UnsignedChunk[T] `serialize:"true"`
Signer [bls.PublicKeyLen]byte `serialize:"true"`
Signature [bls.SignatureLen]byte `serialize:"true"`

bytes []byte
id ids.ID
Expand Down Expand Up @@ -95,12 +92,9 @@ func newChunk[T Tx](
signature [bls.SignatureLen]byte,
) (Chunk[T], error) {
c := Chunk[T]{
Producer: unsignedChunk.Producer,
Beneficiary: unsignedChunk.Beneficiary,
Expiry: unsignedChunk.Expiry,
Txs: unsignedChunk.Txs,
Signer: signer,
Signature: signature,
UnsignedChunk: unsignedChunk,
Signer: signer,
Signature: signature,
}
return c, c.init()
}
Expand Down

0 comments on commit 1957065

Please sign in to comment.