Skip to content

Add constants for private event #5205

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions common/ledger/ledger_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,21 @@ type QueryResult interface{}

// PrunePolicy - a general interface for supporting different pruning policies
type PrunePolicy interface{}

const (
PrivateEventsPrefixAndSeparator = "__hlf_privateEvent__"
PrivateEventsTopLevelName = "__hlf__privateEvents"
)

// PrivateEventPayload is the payload that the chaincode must create for a private event
type PrivateEventPayload struct {
// {mspid1: [id1, id2, ...], ...}
VisibleTo map[string][]string `json:"visibleTo,omitempty"`
Payload interface{} `json:"payload"`
}

// TxnPrivateChaincodeEvents: keys are the event names; values are the event payloads
type TxnPrivateChaincodeEvents map[string][]byte

// BlockPrivateChaincodeEvents: map of TxnPrivateChaincodeEvents - key is the txn index inside the block
type BlockPrivateChaincodeEvents map[int]*TxnPrivateChaincodeEvents
Loading