etcd: remove assertion when creating bucket and value with the same key
This commit removes an assertion which is not needed because with etcd we can safely create keys and values with the same key since they are stored under different keys in the DB. This saves us one unnecessary Get on every Put.
This commit is contained in:
6 files changed
+63
-8
No files matched your search
+8
-2
@@ -19,6 +19,7 @@ var (
|
||||
func TestEtcd(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
debugOnly bool
|
||||
test func(*testing.T, walletdb.DB)
|
||||
expectedDb map[string]string
|
||||
}{
|
||||
@@ -103,8 +104,9 @@ func TestEtcd(t *testing.T) {
|
||||
test: testBucketSequence,
|
||||
},
|
||||
{
|
||||
name: "key clash",
|
||||
test: testKeyClash,
|
||||
name: "key clash",
|
||||
debugOnly: true,
|
||||
test: testKeyClash,
|
||||
expectedDb: map[string]string{
|
||||
bkey("apple"): bval("apple"),
|
||||
bkey("apple", "banana"): bval("apple", "banana"),
|
||||
@@ -137,6 +139,10 @@ func TestEtcd(t *testing.T) {
|
||||
for _, test := range tests {
|
||||
test := test
|
||||
|
||||
if test.debugOnly && !etcdDebug {
|
||||
continue
|
||||
}
|
||||
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
Reference in new issue
Block a user