feat: make schema and core kv-pair updates compatible (#21223)

This commit is contained in:
Aaron Craelius 2024-08-08 16:24:29 -04:00 committed by GitHub
parent b0ab3aaac4
commit f6fee983a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View File

@ -20,7 +20,7 @@ type KVPairs = []KVPair
// KVPair represents a change in a key and value of state.
// Remove being true signals the key must be removed from state.
type KVPair struct {
type KVPair = struct {
// Key defines the key being updated.
Key []byte
// Value defines the value associated with the updated key.

View File

@ -27,14 +27,14 @@ type ModuleCodec struct {
type KVDecoder = func(KVPairUpdate) ([]ObjectUpdate, error)
// KVPairUpdate represents a key-value pair set or delete.
type KVPairUpdate struct {
type KVPairUpdate = struct {
// Key is the key of the key-value pair.
Key []byte
// Value is the value of the key-value pair. It should be ignored when Delete is true.
// Value is the value of the key-value pair. It should be ignored when Remove is true.
Value []byte
// Delete is a flag that indicates that the key-value pair was deleted. If it is false,
// Remove is a flag that indicates that the key-value pair was deleted. If it is false,
// then it is assumed that this has been a set operation.
Delete bool
Remove bool
}