Skip to content

Commit

Permalink
Merge pull request #170 from beaugunderson/master
Browse files Browse the repository at this point in the history
  • Loading branch information
turbolent authored May 25, 2021
2 parents 3f3f5fe + b488e2e commit 9bb50d7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
15 changes: 11 additions & 4 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,16 @@ type BlockPayload struct {
Seals []*BlockSeal
}

// BlockSeal is the attestation by verification nodes that the transactions in a previously
// executed block have been verified.
type BlockSeal struct {
BlockID Identifier
ExecutionReceiptID Identifier
// TODO: ExecutionReceiptSignatures
// TODO: ResultApprovalSignatures
// The ID of the block this Seal refers to (which will be of lower height than this block)
BlockID Identifier

// The ID of the execution receipt generated by the Verifier nodes; the work of verifying a
// block produces the same receipt among all verifying nodes
ExecutionReceiptID Identifier

ExecutionReceiptSignatures [][]byte
ResultApprovalSignatures [][]byte
}
16 changes: 8 additions & 8 deletions client/convert/protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ func CollectionGuaranteeToMessage(g flow.CollectionGuarantee) *entities.Collecti

func BlockSealToMessage(g flow.BlockSeal) *entities.BlockSeal {
return &entities.BlockSeal{
BlockId: g.BlockID.Bytes(),
ExecutionReceiptId: g.ExecutionReceiptID.Bytes(),
// TODO: ExecutionReceiptSignatures
// TODO: ResultApprovalSignatures
BlockId: g.BlockID.Bytes(),
ExecutionReceiptId: g.ExecutionReceiptID.Bytes(),
ExecutionReceiptSignatures: g.ExecutionReceiptSignatures,
ResultApprovalSignatures: g.ResultApprovalSignatures,
}
}

Expand All @@ -291,10 +291,10 @@ func MessageToBlockSeal(m *entities.BlockSeal) (flow.BlockSeal, error) {
}

return flow.BlockSeal{
BlockID: flow.BytesToID(m.BlockId),
ExecutionReceiptID: flow.BytesToID(m.ExecutionReceiptId),
// TODO: ExecutionReceiptSignatures
// TODO: ResultApprovalSignatures
BlockID: flow.BytesToID(m.BlockId),
ExecutionReceiptID: flow.BytesToID(m.ExecutionReceiptId),
ExecutionReceiptSignatures: m.ExecutionReceiptSignatures,
ResultApprovalSignatures: m.ResultApprovalSignatures,
}, nil
}

Expand Down
6 changes: 4 additions & 2 deletions test/entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ func BlockSealGenerator() *BlockSeals {

func (g *BlockSeals) New() *flow.BlockSeal {
return &flow.BlockSeal{
BlockID: g.ids.New(),
ExecutionReceiptID: g.ids.New(),
BlockID: g.ids.New(),
ExecutionReceiptID: g.ids.New(),
ExecutionReceiptSignatures: [][]byte{},
ResultApprovalSignatures: [][]byte{},
}
}

Expand Down

0 comments on commit 9bb50d7

Please sign in to comment.