Skip to content

Commit 6aea20c

Browse files
committed
Update serializeData function name
1 parent 25450e2 commit 6aea20c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

utils/hash.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ func HashLockedData(data common.SecretMap) string {
1616
}
1717

1818
func HashData(data map[string][]byte) string {
19-
return hash(data, serializeSecretData)
19+
return hash(data, serializeData)
2020
}
2121

2222
func hash(data any, serializer func(any) []byte) string {
@@ -56,7 +56,7 @@ func serializeLockedData(data any) []byte {
5656
return dataBuffer
5757
}
5858

59-
func serializeSecretData(data any) []byte {
59+
func serializeData(data any) []byte {
6060
if _, ok := data.(map[string][]byte); !ok {
6161
return []byte{}
6262
}

utils/hash_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestHashData(t *testing.T) {
1515
data["xyz"] = []byte("contentforxyz")
1616
data["abc"] = []byte("1Ag@aZ821Sd1asd1231nkgrniekghis168adf")
1717
testGHFD := []Test{
18-
{"Serialize sample data", []byte("abc\0001Ag@aZ821Sd1asd1231nkgrniekghis168adf\000xyz\000contentforxyz\000"), serializeSecretData(data)},
18+
{"Serialize sample data", []byte("abc\0001Ag@aZ821Sd1asd1231nkgrniekghis168adf\000xyz\000contentforxyz\000"), serializeData(data)},
1919
{"Get hash from serialized data", "2d0b4d0adc4124bdfb959cb8b584473b5392cf2287b69a11663b288c90cfa010", HashData(data)},
2020
}
2121
verifyTests(testGHFD, t)

0 commit comments

Comments
 (0)