From f6fee983a5ad136f03ae13ec689693c4c34b832d Mon Sep 17 00:00:00 2001 From: Aaron Craelius Date: Thu, 8 Aug 2024 16:24:29 -0400 Subject: [PATCH] feat: make schema and core kv-pair updates compatible (#21223) --- core/store/changeset.go | 2 +- schema/decoder.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/store/changeset.go b/core/store/changeset.go index f521432ec6..b1233e8abf 100644 --- a/core/store/changeset.go +++ b/core/store/changeset.go @@ -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. diff --git a/schema/decoder.go b/schema/decoder.go index 86aedec9f9..fcebbf3d7b 100644 --- a/schema/decoder.go +++ b/schema/decoder.go @@ -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 }